javascript - Angular : use filter on ng-options when using for(key,value) -


i have listbox want filter depending on user input, in order display "matches" posibility.

unfortunatly, "filter" change value display or don't work @ all. expect it's because use (key,value) , have different behaviour ?

<p>filter : <input type="text" ng-model="filterattr"/> {{filterattr}}</p> <select ng-options="value (value.attr+ ' : ' +value.otherattr) (key,value) in customlist | filter:{attr:filterattr}"      size="4" ng-model="nevermind" ng-change="changesensor(tyredetails)"> </select> 

here jsffidle : http://jsfiddle.net/hlywvam7/2/

thank help.

in angular filters can applied arrays, not objects.

now either change "customlist" format array or convert "customlist" object array below

$scope.filtercustomlist = function(items) {     var result = [];     angular.foreach(items, function(value, key) {         result[key] = value;     });     return result; } 

Comments

Popular posts from this blog

c - Calling a function within a loop -

vb.net - Unbound DataGridView add row with checkbox error -

How i fill combobox items in Radgridview manually using in vb.net -