A simple directive for using in your angular applications
Demos are in demo
folder.
Open any demo file in browser and begin to use.
npm install angularjs-dropdown
-
Include
angular-dropdown.css
andangular-dropdown.js
in your project fromsrc
folder -
Import
angularDropdown
as a dependecy in your project
angular
.module('nameOfModule', ['angularDropdown'])
- Add the directive to your html
<angular-dropdown
....
></angular-dropdown>
These attributes are available to set on the angular-dropdown
directive.
Chosen items in the dropdown.
Type: array of objects
An array of strings or object to show in the dropdown.
Type: array of objects
Text that will show if items of the dropdown aren't chosen.
Type: string
Default: Select ...
Allow or disallow to choose several items in the dropdown.
Type: boolean
Default: false
Property with unique value in array of objects.
Type: string
Default: id
Value of property that will show in the dropdown.
Type: string
Default: label
Handler of click on item of the dropdown.
Type: function
Handler of click on items of the dropdown.
Type: function
Handler of click on items of the dropdown.
Type: function
You can run the tests:
npm run test
MIT