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

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -