Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter available options #9

Open
chrisv-dev opened this issue Dec 4, 2015 · 1 comment
Open

filter available options #9

chrisv-dev opened this issue Dec 4, 2015 · 1 comment

Comments

@chrisv-dev
Copy link

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?

@yakovkhalinsky
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants