This is my component:
@Component({
selector: 'ngx-pages',
styleUrls: ['pages.component.scss'],
template: `
<ngx-one-column-layout>
<nb-menu [items]="menu"></nb-menu>
<router-outlet></router-outlet>
</ngx-one-column-layout>
`,
})
export class PagesComponent {
constructor(private translate: TranslateService) {
console.log(this.translate.instant('adminPanel'));
}
menu = MENU_ITEMS;
ngOnInit(): void {
MENU_ITEMS[0]["title"]= this.translate.instant('adminPanel');
this.menu = MENU_ITEMS;
}
}
Everything works fine, but changing the menu variable when I overwrite it does not change in the html until I exit the page and re-enter, indicating that it was changed late and does not support the change dynamically. I tried to assign an EventEmitter to the nb menu, but can't, since I can't enter the nb-menu to change it from the inside because it's a null-shaped tag (a frame I downloaded it)