now that the menu is done on the .ts page with a array this.model = [{label:dashboard, icon: 'dashboard', routerLink: ['/']}]
how do we hide a menu item , I have many use cases where I need to hide/show menu items, not sure how to do with the latest release
thanks
hide menu item in 2.0
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
Hi,
Can you explain it more spesific afterwards i will try to replicate and achieve it.
Can you explain it more spesific afterwards i will try to replicate and achieve it.
I will try to explain a little more. in the left side menu, (dashboard, customize, theme) I have other menu names ex.) password, pin, voicemail, speeddials...
some of my users can not see the menu link voicemail, cause they do not have access to our voicemail system. so when this user logs into our application we return a flag (voicemailEnabled: false). When I see this value as false, I need to hide the menu item link voicemail. usually I have them hidden by default and then show the menu item if voicemailEnabled === true.
does that help explain a little better?
The way I can come up with is to create my menu array based on the data then push those menu items to the model array. is there a better solution?
thanks
some of my users can not see the menu link voicemail, cause they do not have access to our voicemail system. so when this user logs into our application we return a flag (voicemailEnabled: false). When I see this value as false, I need to hide the menu item link voicemail. usually I have them hidden by default and then show the menu item if voicemailEnabled === true.
does that help explain a little better?
The way I can come up with is to create my menu array based on the data then push those menu items to the model array. is there a better solution?
thanks
Maybe you can try using *ngIf = voicemailEnabled for deleting it from dom.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
How about removing it from your model so that it will be removed from dom as well.
Another approach would be;
https://github.com/primefaces/primeng/issues/1959
Where we'll bind the visible property to ngIf in menu of Ultima.
Another approach would be;
https://github.com/primefaces/primeng/issues/1959
Where we'll bind the visible property to ngIf in menu of Ultima.
-
- Posts: 1
- Joined: 03 Oct 2019, 08:40
Hi did you get any solution ?? please let me know .. my situation is also same like @mthor .i need to hide/show the label from menu item based on condition
-
- Information
-
Who is online
Users browsing this forum: No registered users and 11 guests