Angular2 Query Params Subscription Fires Twice

后端 未结 8 1504
闹比i
闹比i 2020-12-25 11:07

Trying to handle an OAuth login scenario where if the user lands on a page with authorization_code in the query string, we process the token and continue

8条回答
  •  滥情空心
    2020-12-25 12:04

    Put your subscription code on ngAfterViewInit method,

    ngAfterViewInit() {
        this.route.queryParams.subscribe(params => {
          debugger;
        });
    }
    

提交回复
热议问题