我在从查询字符串获取参数时遇到一些问题。我正在尝试使用
从导入{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
如何获得该参数?