Filter AngularJS without using ngOptions or ngRepeat -
is there way filter select-box without using ng-repeat or ngoptions in angularjs via angular filters($filter).
i have select-option code written this:
<select> <option value="one">one</option> <option value="two">two</option> <option value="three">three</option> </select>
and input box used filter content in options:
<input ng-model="myfilter">
you can use ng-if function.
<option ng-if="checkfilter('group1')" value="one">
and in controller
function checkfilter(value) { return myfilter.filter(function (element) { return element == value }); }
Comments
Post a Comment