Почему * ngIf не обновляет шаблон? Звание приветствуется всегда, независимо от того, что isVisible изменяется на false через 2 секунды.Angular 2 * ngIf не обновлять HTML-шаблон
@Component({
selector: 'my-app',
template: `
<h1 *ngIf="isVisible == true">{{title}}</h1>
`
})
export class AppComponent {
title = 'Hello!';
isVisible = true;
constructor() {
setTimeout(function() {
this.isVisible = false;
console.log(this.isVisible);
}, 2000);
}
}