This is a package to create navigation menus using Angular Material. This follows all the design guidelines provided by Google Material spec.
This package can be installed using bower:
bower install angular-material-accordion
Include the script and CSS files in you HTML and add ngMaterialAccordion
in you module. Also this module has support for browserify or wiredep.
<link rel="stylesheet" href="path/to/angular-material-accordion.css">
<script src="path/to/angular-material-accordion.js"></script>
To use icons with ligatures you should include the reference for the Material Icons:
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
After that you can add the following markup:
<md-accordion>
<md-accordion-group>
<md-subheader class="md-no-sticky">Caption</md-subheader>
<md-accordion-content md-icon="home" md-heading="Menu 1" md-arrow="true">
<md-accordion-button href="#">Submenu 1</md-accordion-button>
<md-accordion-button href="#">Submenu 2</md-accordion-button>
<md-accordion-button href="#">Submenu 3</md-accordion-button>
</md-accordion-content>
</md-accordion-group>
<md-accordion-group>
<md-divider></md-divider>
<md-subheader class="md-no-sticky">Caption</md-subheader>
<md-accordion-button href="#">Menu 4</md-accordion-button>
</md-accordion-group>
</md-accordion>
-
<md-accordion>
Is the main directive to hold all navigation items. -
<md-accordion-group>
Is needed to create groups of content. -
<md-accordion-content>
Define the collapsible navigation element and there's some attributes to setup. The following attributes are available:
md-icon
- You can use font iconsmd-svg-icon
- To use external svg iconsmd-heading
- The title of the sectionmd-arrow
- An optional boolean to show an indicator arrow
<md-accordion-button>
Add the buttons inside the navigation. The following attributes are available:
href
- The href for the buttonui-sref
- The ui-router alternativeui-sref-active
- The highlight class to use with ui-routertarget
- The link target attribute
Pretty easy!
MIT