route url with query params angular 6 code example
Example 1: in angular how to get router url without query params
this.router.url.split('?')[0]
Example 2: get route query params angular
export class HeroComponent implements OnInit {
constructor(private _activatedRoute: ActivatedRoute, private _router:Router) {
_router.routerState.queryParams.subscribe(
params => console.log('queryParams', params['st']));