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

[RFR] Allow the main menu to use a custom template #644

Merged
merged 1 commit into from
Sep 1, 2015

Conversation

fzaninotto
Copy link
Member

No description provided.

fzaninotto added a commit that referenced this pull request Sep 1, 2015
[RFR] Allow the main menu to use a custom template
@fzaninotto fzaninotto merged commit e7487fb into master Sep 1, 2015
@fzaninotto fzaninotto deleted the menu_template branch September 1, 2015 13:37
@cmnstmntmn
Copy link

@fzaninotto i am trying to remap the content of menu.js to a custom template.

  1. i changed the whole layout.html
    admin.layout(require('./layout.html'));
    admin.header(require('./header.html'));
    admin.menu(require('./menu')(nga, admin));
    admin.dashboard(require('./dashboard/config')(nga, admin));
  1. somewhere in layount.html, i am trying to

    <span compile="::appController.menu"></span>

i only get an array, becauze the template, is missing from the equation.
screen shot 2015-09-14 at 22 14 16


i get no luck even if put hte content of menuBar.html inside layout.html

my question is: can this admin.menu() accep both data, and a custom template ?

thank you

@fzaninotto
Copy link
Member Author

appController.menu is a Menu object. Don't try to output it in a template, it doesn't make any sense. It contains both menus (data) and the template.

Why don't you use the <ma-menu-bar> directive?

@cmnstmntmn
Copy link

well, it's more a markup/css issue ..

having ul.nav nested in two other divs, makes things a bit hard on css side.

screen shot 2015-09-17 at 21 14 30

i wanted to achieve this kind of markup for the aside bar

aside

but having both header and <ma-menu-bar> inside <nav makes it tricky

@fzaninotto
Copy link
Member Author

Then do the markup and the directives you want. But don't try to output a JS object to HTML, it doesn't make sense.

@cmnstmntmn
Copy link

does <ma-menu-bar> can be extended?
i think the easiest way to achive this, is to append a custom mark-up to <ma-menu-bar> directive

@fzaninotto
Copy link
Member Author

You can customize the template of every directive in ng-admin (and in Angular.js in general).

https://github.com/marmelab/ng-admin/blob/master/doc/Theming.md#customizing-directives-templates

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

Successfully merging this pull request may close these issues.

2 participants