I know there are plenty of questions out there about Change Detection but i can't get my head around this one...
I would like to update the view of a component every time a function gets called, how would i do that?
app.component.ts
this.translate.onLangChange.subscribe(() => {
this.cd.detectChanges();
this.cd.markForCheck();
});
- Here every time i click on an image the language will be updated hence i'll recieve something on the subscribe method
- constructor holds this
private readonly translate: TranslateService
How do i refresh the view each time i change language?