AngularJS - select with zero(0) value -
select options are:
`[ {statusid: 0, statusdesc: "new"}, {statusid: 10, statusdesc: "enabled"}, {statusid: 30, statusdesc: "inprogess"}, {statusid: 70, statusdesc: "done"} ];`
in order display values have added option "all" value ""
<select id="statusid" name="statusid" ng-model="search.statusid" ng-options="status.statusid status.statusdesc status in statuslist"> <option value="">all</option> </select>
problem on selecting new value 0 display values while selecting all displays nothing.
you can find sample code here.
you need make 2 changes..
in itemslist json, status ids in string, convert them numbers.
you have angular want strict comparaison. that's easy angular 1.1.5, because filter filter has third parameter, comparator, true useful shorthand.
e.g.
<tr ng-repeat="item in itemlist | filter:search:true">
updated fiddle : http://jsfiddle.net/gwnfkxmc/1/
Comments
Post a Comment