How to restart ngOnInit to update Interpolation
问题 Is there way to restart ngOnInit() on change variable Because I want to restart ngOnInit() on change theme variable, this is my code Settings.ts export class SettingsPage implements OnInit{ phraseColor: string; ngOnInit() { let tch : {} = {'#3f51b5': 'Blue', '#ff9800': 'Orange'} let ColorName = tch[this.settingsService.theme]; /* here my problem */ this.phraseColor = ColorName; } changeTheme(){ this.settingsService.theme = '#ff9800'; } } Settings.html <div>Theme is {{ phraseColor }}</div>