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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -