angular-chosen rightster fork - contains changes that may not be suitable for upstream
npm install angular-chosen-rightsterangular-chosen
==============
AngularJS Chosen directive
This directive brings the Chosen jQuery plugin
into AngularJS with ngModel and ngOptions integration.
To use, include "localytics.directives" as a dependency in your Angular module. You can now
use the "chosen" directive as an attribute on any select element. Angular version 1.2+ is required.
$ bower install angular-chosen-localytics --save
ngModel and ngOptionsngOptionsChosen via attributes or by passing an object to the Chosen directive$("#states").chosen()``html`
`html`
data-placeholder="Pick one of these"
disable-search="true"
allow-single-deselect="true">
allow-single-deselect
Note: the empty option element is mandatory when using
`html`
chosen
ng-model="state"
ng-options="s for s in states">
Note: don't try to use ngModel with ngRepeat. It won't work. Use ngOptions. It's better that way.
Also important: if your ngModel is null or undefined, you must manually include an empty option inside your
`html`
chosen
ng-model="state"
ng-options="s for s in states">
This annoying behavior is alluded to in the examples in the documentation for ngOptions.
#### Works well with other AngularJS directives
`html`
ng-model="state"
ng-options="s for s in states"
ng-disabled="editable">
##### app.js
`js`
angular.module('App', ['ngResource', 'localytics.directives'])
.controller('BeerCtrl', function($scope) {
$scope.beers = $resource('api/beers').query()
});
##### index.html
`html`
data-placeholder="Choose a beer"
no-results-text="'Could not find any beers :('"
ng-model="beer"
ng-options="b for b in beers">
Image of select defined above in loading state: 
Note: Assigning promises directly to scope is now deprecated in Angular 1.2+. Assign the results of the promise to scope
once the promise returns. The loader animation will still work as long as the collection expression
evaluates to undefined` while your data is loading!
See the example directory for more detailed usage.