Skip to content

RossRogers/ng-selectize

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

This is an Angular.js directive for Brian Reavis's selectize jQuery plugin (http://brianreavis.github.io/selectize.js/).

Info

Module: 'clientApp'

Directive: 'selectize'

Using:

<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]"]
>

Attributes:

  • selectize - this attribute is passed directly to selectize.js whose parameters are defined in selectize.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 AngularJS selectize 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 JSON labelField and valueField parameters that are the values of the element's selectize attribute. Defaults for those parameters may be seen in the selectize.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 the selectize object is placed.

About

AngularJS directive for Selectize.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%