I recently updated my project from Angular 15 to Angular 17. Since then I have been having this issue.
When this.router.navigate(['sample', 'route']) function is triggered, the URL gets changed but the page is not loaded. I debugged in the browser and saw that the control is not getting inside ngOnInit() function of the component called.
This functionality was working fine in previous version i.e., Angular 15
I ran into the same issue; assuming you are injecting the Router instance using the inject method, please note that there is a difference between
Inject(Router)andinject(Router)You need to use the latter. i.e.