Issue
I have the following url ,
product/example/:example/example1/:example1?query1=:query1&query2=:query2
I want to get the values that is specified in the path and query parameters, I have tried this but it retrieves only the path variables not the query params
this.sub = this.route.params.subscribe(params => {
this.example= params['example'];
this.example1 = params['example1'];
this.query1=params['query1'];
this.query2=params['query2'];
});
Is there a way that I can get all 4 values ?
Solution
I think the ActivatedRoute
has a property called queryParams, try subscribing to that and not to params. Example
Answered By - Fussel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.