Adamantium Menu refresh Bindings

UI Components for Angular
Post Reply
fibrenoire
Posts: 14
Joined: 18 Jul 2016, 21:26

09 Aug 2016, 14:26

I would define dynamic menu entry with Adamantium Layout.
I see in layout that menu items and binding are initialized during ngAfterViewInit :

Code: Select all

ngAfterViewInit() {
        Adamantium.init();
    }
Then, Init is storing "menulink" :

Code: Select all

init: function() {
        this.menuWrapper = $('#layout-menu-cover');
        this.menu = this.menuWrapper.find('ul.layout-menu');
        this.menulinks = this.menu.find('a.menulink');
        this.menuButton = $('#menu-button');
        this.topMenu = $('#top-menu');
        this.topMenuButton = $('#topmenu-button');
        this.expandedMenuitems = this.expandedMenuitems||[];
        this.layoutMenuClick = false;
	this.topbarMenuClick = false;
        
        this.bindEvents();
        
        this.initRipple();
    }
Menu click is not more working with conditional menu items like :

Code: Select all

<li *ngIf="isOk > 1" role="menuitem"><a class="menulink" [routerLink]="['/pageone']"><i class="fa fa-cloud Fs16" style="min-width:20px;"></i>Page 1</a></li>
<li *ngIf="! isOk" role="menuitem"><a class="menulink" [routerLink]="['/pagetwo']"><i class="fa fa-cloud Fs16" style="min-width:20px;"></i>Page 2</a></li>
Is there any way to update binding from component ? By refreshing the menu items list and binding ?

Chris

ribizli
Posts: 3
Joined: 29 Nov 2013, 12:28

29 Aug 2016, 12:37

I think, the menu for NG should be rewritten in an Angular2 way, using components, not using jQuery in an external JS file.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests