angularjs ng-options dictionary filter not empty -


<select ng-model="new_key" ng-change="evaluate($parent.$index, k, new_key)" ng-options="key key+'('+value+')' (key, value) in vars"> 

vars has 3 keys. 1 value undefined. how create select valid values?

enter image description here

you can try add below filter in controller

$scope.removenull = function(itm) {  if(itm.value)return itm; else return; }; 

and add filter in ng-options

ng-options="key key+'('+value+')' (key, value) in vars | filter : removenull" 

remove null

hope you.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -