DEV Community

Salah Hasanin
Salah Hasanin

Posted on

Answer: Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?

My issue fixed by wrapping the router navigation command in ngZone. Please check the code below

in constructor add "private zone: NgZone".

private zone: NgZone

this.zone.run(() => {
                    this.router.navigate(['/login']);
                });

Top comments (0)