Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mainMenuService should support submenus #16

Open
ftorghele opened this issue May 18, 2015 · 1 comment
Open

mainMenuService should support submenus #16

ftorghele opened this issue May 18, 2015 · 1 comment

Comments

@ftorghele
Copy link
Contributor

Currently it is only possible to add a MenuEntry or MenuGroup to a Menu.

It should also be possible to add another Menu (Submenu) to a Menu if there are to many Entries to display in the first Level or an additional hierarchy makes sense.

@tsalzinger
Copy link
Contributor

i completely agree with this
the current implementation is one of the oldest within cat-angular (as can be seen by the name $mainMenu instead of something like catMenuService)

currently the top element is a MenuBar, followed by Menu and then either MenuGroup or MenuEntry

much better would it be to replace the MenuBar with just Menu, as a generic container element, which in turn can contain Menu, or MenuEntry elmements

as for MenuGroup items i'm not yet completely sure whether or not these should be part of the hierarchy or just a special type of a MenuEntry (similar to menu separators in java swing applications)
both solutions have it's benefits and drawbacks respectively. But one important part is that the service is just here for providing a model which represents the whole menu, therefor i'm more inclined to go for the latter implementation as the service doesn't have to know anything about groups this way.

how this model is rendered is entirely up to the directive and can also be customized quite easily either by providing a custom directive template for small changes, or by just implementing a custom directive altogether

the service in itself doesn't prohibit you from adding any options to you like to the menu entry, so providing a custom directive which allows for menu groups to be rendered as sub-menus would be easily possible without changing the current service implemenation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants