Reputation: 87
I have some problem on getting parameter from query string. I'm trying using
import { URLSearchParams } from '@angular/http';
this.params = new URLSearchParams(window.location.search); this.params1 = this.params.getAll('param'); console.log('parameter: '+JSON.stringify(this.params1))
and when I'm try to access http://localhost:8100/param=1
it getting error Cannot GET /param=1
How can I get that param?
Upvotes: 0
Views: 1832
Reputation: 87
Okay, i'm try using this.platform.getQueryParam('param');
and it working fine.
Upvotes: 1