Angular material-like dropdown component
npm install ng2-material-dropdownMaterial-like dropdown component for Angular2.
npm install ng2-material-dropdown --save
Once installed, import the directives and use it them your container component:
``html
Open Menu
{{ page }}
With Divider
`
`javascript
// import module
import { Ng2DropdownModule } from 'ng2-material-dropdown';
@NgModule({
imports: [ Ng2DropdownModule ]
// ..
})
export class MyModule {}
`
ng2-dropdowndynamicUpdate
- - [?boolean] : option to disable the dynamic update of the position on scroll events (defaults to true)onItemSelected()
- - [(onItemSelected($event)] : event that emits the currently selected/hovered itemonItemClicked()
- - [(onItemClicked($event)] : event that emits the item clicked ononShow()
- - [(onItemClicked($event)] : event that emits when the dropdown gets shownonHide()
- - [(onItemClicked($event)] : event that emits when the dropdown gets hidden
ng2-dropdown-menufocusFirstElement
- - [?boolean] : by default the first element is immediately focused. You can disable by setting this option to falsewidth
- - [?number]: this determines the width of the menu. Possible values are 2, 4 and 6. By default, this is set to 4offset
- - [?string]: offset to adjust the position of the dropdown with absolute valuesappendToBody
- - [?boolean] : by default the dropdown is appended to the body, but you can disable this by setting it to false
ng2-dropdown-buttonshowCaret
- - [?boolean] : if present, a caret will be appended to the button's text
ng2-menu-itempreventClose
- - [?boolean] : if present, this attribute prevents the menu to hide when the menu item is clickedvalue
- - [?any]` : any value that you may want to attach to a menu item. Useful for using this component with other components.