How can I add values to an AngularJS <select> without changing the data source? -
i have coded following:
<select data-ng-disabled="!option.selectedsubject" data-ng-model="option.selectedcontentstatus" data-ng-options="item.id item.status item in option.contentstatuses"> <option style="display: none" value="">select content status</option> </select>
this give me list of statuses me select from. add 1 addition list value of "99" , name of "all". tried:
<select data-ng-disabled="!option.selectedsubject" data-ng-model="option.selectedcontentstatus" data-ng-options="item.id item.status item in option.contentstatuses"> <option style="display: none" value="">select content status</option> <option value="99">all</option> </select>
but not work. see select content status , additional option 99 not appear.
is there way can make possible additional option without making change array option.contentstatuses?
you ng-repeat on options want generated via data next static option values within select:
<select ng-model="option.selectedcontentstatus"> <option value="">select content status</option> <option value="99"> </option> <option ng-repeat="item.id item.status item in option.contentstatuses" value="{{item.id}}">{{item.status}}</option> </select>
Comments
Post a Comment