1

How I can get params this way:

mydomain.com/?token=MY_TOKEN&some=test

How I can get the token and the some from the URL to my angular 2 component? I tried:

this.route.params
    .subscribe((params) => {
        this.token = params['token'];
        this.some = params['some'];
    });
TheUnreal
  • 23,434
  • 46
  • 157
  • 277

1 Answers1

0

This are query params you are looking for

this.route.queryParams
.subscribe((params) => {
    this.token = params['token'];
    this.some = params['some'];
});
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567