ngOnInit() {
this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
if (event.url === '/common/time') {
this.zone.run(() => {
setTimeout(()=> {
this.index = 2;
this.trial = "Trial";
console.log(`Inside idx: ${this.index}`);
}, 100);
});
}
}
});
console.log(`Outside idx: ${this.index}`);
this.loadMonetaryCondition();
this.loadGoals();
}
< /code>
У меня есть такой шаблон, как этот блок уверен, выполняется. Но значения не обновлены. У меня есть шаблон следующим образом < /p>
Value {{index}} {{trial}}
Подробнее здесь: https://stackoverflow.com/questions/795 ... -feel-it-i
Мобильная версия