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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -