angular-selectize
Demo
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
Dependencies
Install
Install with Bower
$ bower install angular-selectize2
Load the script files in your application:
Add the selectize module as a dependency to your application module:
var myAppModule = angular;
Basic Usage
Setup your controller variables:
$scopemyModel;$scopemyOptions = 'Spectrometer' 'Star Chart' 'Laser Pointer';
Add the selectize element to your view template:
Advanced Usage
$scopemyModel = 1; $scopemyOptions = id: 1 title: 'Spectrometer' id: 2 title: 'Star Chart' id: 3 title: 'Laser Pointer'; $scopemyConfig = create: true valueField: 'id' labelField: 'title' delimiter: '|' placeholder: 'Pick something' { // receives the selectize object as an argument } // maxItems: 1;
Documentation
Config
Inline
Global
To define global defaults, you can configure the selectize
injectable:
MyAppvalue'selectizeConfig' delimiter: '|';