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?
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"
hope you.
Comments
Post a Comment