如何从离子查询字符串中获取参数?

我在从查询字符串获取参数时遇到一些问题。我正在尝试使用

  

从导入{URLSearchParams}   '@ angular / http';

     

this.params =新的URLSearchParams(window.location.search);   this.params1 = this.params.getall('param');   console.log('parameter:'+ JSON.stringify(this.params1))

,当我尝试访问http://localhost:8100/param=1时收到错误消息Cannot GET /param=1

如何获得该参数?

qq961279346 回答:如何从离子查询字符串中获取参数?

好的,我尝试使用this.platform.getQueryParam('param');,它可以正常工作。

本文链接:https://www.f2er.com/3155028.html

大家都在问