AngularJS directive for selectize
npm install @synconset/angular-selectizeangular-selectize
==================
!selectize5
###Demo
Try the Demo on Plunker
###Features
This is an Angular.js directive for Brian Reavis's selectize jQuery plugin. It supports all of Selectize's features. Here are some highlights:
* Better performance than UI-Select (ui-select vs angular-selectize)
* Selectize is ~7kb (gzipped)
* Smart Ranking / Multi-Property Searching & Sorting
* Angular Models & Bindings
* Skinnable
* Keyboard support
- AngularJS
- JQuery
- Selectize
$ bower install angular-selectize2
Load the script files in your application:
``html`
Add the selectize module as a dependency to your application module:
`javascript`
var myAppModule = angular.module('MyApp', ['selectize']);
`javascript`
$scope.myModel;
$scope.myOptions = ['Spectrometer', 'Star Chart', 'Laser Pointer'];
Add the selectize element to your view template:
`html`
`javascript
$scope.myModel = 1;
$scope.myOptions = [
{id: 1, title: 'Spectrometer'},
{id: 2, title: 'Star Chart'},
{id: 3, title: 'Laser Pointer'}
];
$scope.myConfig = {
create: true,
valueField: 'id',
labelField: 'title',
delimiter: '|',
placeholder: 'Pick something',
onInitialize: function(selectize){
// receives the selectize object as an argument
},
// maxItems: 1
};
`
`html`
##Documentation
- Selectize config options
- Selectize API
##Config
####Inline
`html`
####Global
To define global defaults, you can configure the selectize injectable:
`javascript``
MyApp.value('selectizeConfig', {
delimiter: '|'
});