im having trouble trying to leave the page whit pagination on a list.
original route => path: 'produtos/:categoria/:productId'
so when an enter the page i add this to init
updatePage(pageIndex:number){
this.currentPage = pageIndex;
this._router.navigate([], {
relativeTo: this.route,
queryParams: {
page: pageIndex
},
queryParamsHandling: 'merge',
});
}
And this code above works fine eg
then i press backbutton
i cant leave this page for some reason, keeps reloading at same page
When navigating to add query params, try adding replaceUrl: true
. That should allow back button to work as if you hadn't created a new navigation event
https://angular.io/api/router/NavigationBehaviorOptions#replaceUrl