An open API service indexing awesome lists of open source software.

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

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