I have an issue with query params. Each router has a bit different queryParams.
$stateProvider allowed to define queryParams inside $state
.state('contacts.list', {
templateUrl: 'contacts.list.html',
url: '/test?test1&test2'
data: {
customData1: 44,
customData2: "red"
}
})
This code allows to get from queryParams only test1 and test2 fields.
About new Angular router, if I need watch queryParams, I should subscribe
this.activatedRoute.queryParams.subscribe(params => {
});
This code has an issues, if I type in url some third party test3=lol, I will get this param in argument params and I don't want to filter it in all places
How can I set '/test?test1&test2' in Angular 5 router