app.component.html
{{loading_message}}
app.component.ts
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
providers: [ApiBridgeService]
})
export class AppComponent {
title = 'app works!';
loading_message: String;
constructor() {
this.loading_message = "Init";
setInterval(this.change_loading_message, 1000)
}
change_loading_message() {
this.loading_message = "Executing"
}
}
In html it always displays Init
Expected result :
It should display executing after a 1000ms.