How To Implement The Change Menu In Angular 2
I have a navigation: Log in, Sign up, etc. I have implemented sign up with Google in angular 2 and after I go through Google I want that my navigation dynamically changed on Logout
Solution 1:
That's happen because you are doing some action outside of ngZone. To solve this issue first import ngZone:
import {NgZone} from"@angular/core";
then inject it into component that doing async call for google login:
constructor(private zone: NgZone)
finally run the handling of all angular2 variables that you doing in callback inside ngzone:
(googleUser) => {
this.zone.run( () => {
....
});
}
Post a Comment for "How To Implement The Change Menu In Angular 2"