tomastrajan / angular-ngrx-material-starter

Angular, NgRx, Angular CLI & Angular Material Starter Project
https://tomastrajan.github.io/angular-ngrx-material-starter
MIT License
2.82k stars 919 forks source link

Stop a redirect to the default route on error #398

Closed harm-less closed 5 years ago

harm-less commented 5 years ago

Minimal reproduction of the bug with instructions:

Make a critical error on a route you're visiting. For example by not importing a component you're using.

Expected behavior:

I want to it stay on the same page/route without redirecting back to http://localhost:4200/ or http://localhost:4200/about. It doesn't do this on every error, but even when you are already on a specific page and make a fatal error I expect it it to report the error and stay on that page. At least while developing this is a very annoying behavior.

Other information:

I tried searching the code and angular-cli in general, but nothing I could find about this topic. I'm hoping I missed a small detail somewhere.

timdeschryver commented 5 years ago

I think this is just how the Angular routing works. I could be wrong tho.

tomastrajan commented 5 years ago

@harm-less does this only hapen on lazy routes or ? I am not aware of any specific code in our Exception handler which would lead to such a behaviour...

tomastrajan commented 5 years ago

Project went through major update to Angular 8, please open new issue if the behavior persists. ( Old issue cleanup)