Arshad Mehmood

Search the blog

    Get query parameters

    angular21 min read

    If you want to get the query parameters:

    import {ActivatedRoute} from '@angular/router';
    ...
    constructor(private route:ActivatedRoute){}
    bankName:string;
    ngOnInit(){
    // 'bank' is the name of the route parameter
    this.bankName = this.route.snapshot.params['bank'];
    }

    Solution found here: https://stackoverflow.com/questions/40275862/how-to-get-parameter-on-angular2-route-in-angular-way