Answers for "in angular how to get router url without query params"

4

angular get url param

constructor(private activatedRoute: ActivatedRoute) {
  this.activatedRoute.queryParams.subscribe(params => {
        let date = params['startdate'];
        console.log(date); // Print the parameter to the console. 
    });
}
Posted by: Guest on November-25-2020
0

in angular how to get router url without query params

this.router.url.split('?')[0]
Posted by: Guest on October-06-2020
-1

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']));
Posted by: Guest on July-08-2020

Code answers related to "in angular how to get router url without query params"

Code answers related to "Javascript"

Browse Popular Code Answers by Language