ShankyTiwari / ng-material-multilevel-menu

:page_facing_up: Material Multi-Level Menu for Angular Projects
http://plugins.codershood.info/#/plugins/ngmm-plugin
MIT License
98 stars 55 forks source link

Randomized ID and dynamically changed menu items #150

Closed marxsk closed 3 years ago

marxsk commented 3 years ago

Hi, thanks for a nice module.

In the current setup, it is a bit more complex task to work with menu that (might) change. It is possible that there is a better way of how to do it. If not, I'm willing to prepare PR if you wish :)

ShankyTiwari commented 3 years ago

Hey @marxsk,

Point 1:

Yeah, I think you can manage this easily without adding any extra arrangements. You can change the menu item's disabled property whenever the application detects the role change. You can refer to this issue #8 and let me know if it works for you.

Point 2: You are absolutely correct. Right now, there is no way we can know the ID of menu items, I should’ve added something like what you are suggesting.

Yes, A PR would be lovely. You can add @output named as (menuIsReady) and this event/callback will return menus array with all information.

Thanks Shashank

marxsk commented 3 years ago

1) ah, I though that disabled is about not being able to click on the item. In my case they are not displayed at all. I will give it a try

2) ok, I will prepare PR

ShankyTiwari commented 3 years ago

Hi @marxsk

ah, I though that disabled is about not being able to click on the item. In my case they are not displayed at all. I will give it a try

Please try it and if it doesn’t work you can share the the https://stackblitz.com/ demo, so that I will also check it.

ok, I will prepare PR Awesome

Thanks

marxsk commented 3 years ago

(1) ok, so I was right :) and you as well. The issue is that there is not only "disabled" property [that acts as expected; so item is visible but cannot be activated] but there is also "hidden" propert [that acts as expected].

ShankyTiwari commented 3 years ago

Fixed in 5.5.2.

marxsk commented 3 years ago

Thanks, it works