-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: ChangeDetector over HttpErrorHandler #208
Labels
type: bug
Indicates an unintended behaviour, unexpected problem, crash
Comments
dominique-mueller
added
the
type: bug
Indicates an unintended behaviour, unexpected problem, crash
label
May 6, 2021
I stumbled upon the same issue and found a fix on the export class AppErrorHandler implements ErrorHandler {
constructor(
private toasterService: ToasterService,
private ngZone : NgZone) { }
handleError(error: any): void {
this.ngZone.run(() => {
this.toasterService.pop('error', "Error", error);
});
}
} This should probably adapted slightly and just be added to the official documentation and we are good to go. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If an message gets queued in the the angular ErrorHandler.handleError(error: any) method,
the notification will not get rendered until some other page change.
Workaround:
To display the message instantly a force change detection can be triggered with
(<any>this.notifierContainer).changeDetector.detectChanges();
The text was updated successfully, but these errors were encountered: