-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Description
I'm submitting a
[x] bug report => search github for a similar issue or PR before submitting
I saw similar issue here: #7381
But it doesn't helped me, since current angular version isn't using babel
Current behavior
After asynchronous function is called, variable changes to true, but *ngIf doesn't showing up the item
After 5-30 seconds it detect variable change and showing item
Expected behavior
After asynchronous function is called, variable changes to true => *ngIf should showing up the item instantly
Minimal reproduction of the problem with instructions
https://angular-binding-bug.firebaseapp.com/ - demo
- open console
- try to sign in using google
- see that username doesn't appear, but console output showed correct results
https://github.com/montylab/angular2_cd_bug
<li *ngIf="isAuth" class="user">
{{username}}
...
LI doesn't showing up after isAuth changed to true
this.authService.onAuthStateChange.subscribe((isAuth) => {
this.username = this.authService.getUsername();
this.isAuth = isAuth;
console.log('fires subject - ', 'isAuth: ' + isAuth, 'name: '+ this.username);
console.log('context: ', this);
});
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Windows 10, PHP Storm, npm, ng cli serve
- Angular version: 4.0.3
- Browser: Chrome (sometimes it works, try incognito mode), probably all.
- Language: Typescript 2.2.0