I'm trying to implement error handler using Angular 5.0.0.
In the error handler implementing ErrorHandler
interface I change the current route to the error component route:
router.navigate(['/error'], {queryParams: errorWithContextInfo});
The URL in the browser bar changes, the component HTML is displayed, constructor
is called, onInit
is not called, the member variables are not accessible in the view (always empty, even when they are public and have default value).
Then, when I hit F5, error route is loaded properly, all member variables changed in the constructor on onInit hook are accessible in the view as expected.
How can I fix this behavior? (queryParams should be accessible in the component view right after navigation).