Answers for "angular 9 change menu link item at runtime"

0

angular 9 change menu link item at runtime

import { Component } from '@angular/core';
import { NbMenuService, NbMenuItem } from '@nebular/theme';

@Component({
  selector: 'app-pages',
  template: `
            <app-layout>
              <nb-menu [items]="menu"></nb-menu>
              <router-outlet></router-outlet>
            </app-layout>
            `,
})
export class PagesComponent {
  menu = [];
  newMenuItem: NbMenuItem[] = [
  {
    title: 'Home',
    icon: 'ion-home',
    link: 'app/home',
    home: true,
  }]
  constructor( private nbMenuService: NbMenuService ) {
    this.nbMenuService.addItems(this.newMenuItem);
  }
}
Posted by: Guest on May-24-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language