在这里使用这段代码我在下拉列表中获得了作者姓名..但是当我选择了另一个作者姓名并保存时,它无法在table.it上显示默认作者名称always.how来处理这个?
代码:
<script type="text/ng-template" id="edit">
<td><input type="text" ng-model="selected.title"/></td>
<td><select class="form-control" name="myselection" id="myselection" ng-model="data.myselection" multiple>
<!--select name="singleSelect" id="singleSelect" ng-model="data.singleSelect"-->
<option value="0" selected="selected" >- Select Author -</option>
<option ng-repeat="x in authorlist" value="{{x.id}}">{{x.authorname}}</option>
</select></td>
<td><input type="text" ng-model="selected.price" /></td>
<td>
<button ng-click="saveBook($index)">Save</button>
<button ng-click="reset()">Cancel</button>
</td>
</script>