Example
http://localhost:4200/login?aUasas129198
resolves to
http://localhost:4200/login
What should I do if I want the value after '?'
I tried doing
{ path: 'login/:id', component: LoginComponent },
But it did not work
I also tried
console.log(this.route.snapshot.queryParams);
console.log(this.route.snapshot.params);
But they both return empty object. What should I do now please help
login/:idmakes id aqueryParam. You should also be usingthis.route.queryParams.subscribe(queryParams => console.log(queryParams))Also, apparently there's no value of the queryParam that you're specifying.paraminstead of aqueryParamin that case. Also make sure to subscribe toroute.paramsinstead of usingroute.snapshot.params