https://github.com/alexeykorkoza/angularjs-dropdown
A simple directive for using in your angular applications
https://github.com/alexeykorkoza/angularjs-dropdown
angular dropdown
Last synced: about 2 months ago
JSON representation
A simple directive for using in your angular applications
- Host: GitHub
- URL: https://github.com/alexeykorkoza/angularjs-dropdown
- Owner: AlexeyKorkoza
- License: mit
- Created: 2017-12-10T16:24:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-23T20:56:12.000Z (almost 8 years ago)
- Last Synced: 2025-10-22T06:13:04.701Z (8 months ago)
- Topics: angular, dropdown
- Language: JavaScript
- Homepage:
- Size: 124 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# angularjs-dropdown
A simple directive for using in your angular applications
## Demo
Demos are in ```demo``` folder.
Open any demo file in browser and begin to use.
## Install
```
npm install angularjs-dropdown
```
## Usage
1. Include ```angular-dropdown.css``` and ```angular-dropdown.js``` in your project from ```src``` folder
2. Import ```angularDropdown``` as a dependecy in your project
```
angular
.module('nameOfModule', ['angularDropdown'])
```
3. Add the directive to your html
```
```
## Attributes
These attributes are available to set on the ```angular-dropdown``` directive.
##### dd-model
Chosen items in the dropdown.
Type: `array of objects`
##### dd-data
An array of strings or object to show in the dropdown.
Type: `array of objects`
##### dd-placeholder
Text that will show if items of the dropdown aren't chosen.
Type: `string`
Default: `Select ...`
##### dd-multiple
Allow or disallow to choose several items in the dropdown.
Type: `boolean`
Default: `false`
##### dd-value
Property with unique value in array of objects.
Type: `string`
Default: `id`
##### dd-label
Value of property that will show in the dropdown.
Type: `string`
Default: `label`
##### dd-click
Handler of click on item of the dropdown.
Type: `function`
##### dd-select-all
Handler of click on items of the dropdown.
Type: `function`
##### dd-deselect-all
Handler of click on items of the dropdown.
Type: `function`
## Test
You can run the tests:
```
npm run test
```
## License
MIT