1.0.3 • Published 6 years ago

angularjs-dropdown v1.0.3

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

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'])
  1. Add the directive to your html
<angular-dropdown
  ....
></angular-dropdown>

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