This is an Angular.js directive for Brian Reavis's selectize jQuery plugin (http://brianreavis.github.io/selectize.js/).
Module: 'clientApp'
Directive: 'selectize'
<select
name=""
selectize="{
delimiter: ',',
persist: false
}"
[selectize-options-ng-model="MyAngularJSDataToWatch"]
[selectize-value-ng-model="SelectedValue"]
[selectize-inst-ref="data.place_to_put_selectize_object_reference[42]"]
>
-
selectize
- this attribute is passed directly to selectize.js whose parameters are defined inselectize.js's
documentation.This parameter can have references to functions and objects on your
$scope
as they will be automatically resolved to the object reference itself through use of the$scope.$eval
-
selectize-options-ng-model
- tells the AngularJSselectize
directive to listen for any changes to the specified data array in the current$scope
and then to update the options in the selectize widget with any new options in the updated array.selectize.js
will grab the fields in each element of the array according to the JSONlabelField
andvalueField
parameters that are the values of the element'sselectize
attribute. Defaults for those parameters may be seen in theselectize.js
options documentation -
selectize-value-ng-model
- location that the selected value will be placed when the user sets it and a way to set the selected value which will propagate to the selectize inst. -
selectize-inst-ref
- a variable name under$scope
where a reference to theselectize
object is placed.