ng-selectize icon indicating copy to clipboard operation
ng-selectize copied to clipboard

filter available options

Open chrisv-dev opened this issue 10 years ago • 1 comments

I'd like to filter the listed options from ng-selectize. For a "normal" <select> I do it like this:

$scope.objects = [ ... ];
$scope.myFilters = {type:'tv', country:'Austria'};
      <select ng-model="selectedObject" >
          <option ng-repeat="o in objects | filter:myFilters:strict">{{o.name}}</option>
      </select>

Now with ng-selectize I do not have the <option>-tags because they are generated from the variable given in the options attribute

<select selectize="" options="objects" ng-model="selectedObject" ng-disabled="disabled"></select>

Is there a way how I can still do this with ng-selectize?

chrisv-dev avatar Dec 04 '15 15:12 chrisv-dev

Have you tried changing options="objects" to options="filteredObjects"?

In theory the two way binding should do the trick, or bind to a function that returns a filtered collection.

yakovkhalinsky avatar Dec 04 '15 23:12 yakovkhalinsky