What is the best way to get entire url content in angular 2. Basically i need params and queryParams. Right now i am stuck here :
ngOnInit() { this.activatedRoute.queryParams.subscribe(queryParam =>{ console.log(queryParam); }); this.activatedRoute.params.subscribe(params =>{ const category = params['category']; this.seoService.setTitle(category); // This is wrong because i also need queryParams here this.categoryService.updateCategory(category); }); } } This is the best that i could come up with. I aim for url`s like this /category-name?page=1&sortBy=something&size=30&sortOrder=ASC&L=UTF-8
I am trying to get the next value out of activatedRoute and assemble an object with all information and then call back-end service.