我如何以这种方式获得params:
mydomain.com/?token=MY_TOKEN&some=test
如何从网址token
和some
获取角度2组件?
我试过了:
this.route.params
.subscribe((params) => {
this.token = params['token'];
this.some = params['some'];
});
答案 0 :(得分:0)
这是您正在寻找的查询参数
this.route.queryParams
.subscribe((params) => {
this.token = params['token'];
this.some = params['some'];
});