If you're not using Angular router try, querystring. Install it
npm install --save querystring
to your project. In your component do something like this
import * as qs from 'querystring';
...
ngOnInit() {
const params = qs.parse(window.location.search.substring(1));
...
}
The substring(1)
is necessary because if you have something like this '/mypage?foo=bar'
then the key name for will be ?foo