0
當我嘗試下面的代碼:角度值NG選項是使用選擇的標籤語法沒有設置
<select name="test" id="test" ng-model="test"
ng-options="c.id as c.n for c in [{n:'t1',id:'123'}]">
</select>
我得到
<select name="test" id="test" ng-model="test" >
<option value="0" selected="selected" label="t1">t1</option>
</select>
爲什麼值不是「123」每個角的NG -options語法。
謝謝,
它不像在提交表單時被送到了'value'正常的表單字段。 'ng-model'綁定將適當地設置值。見http://plnkr.co/edit/sbGnniTffW9iXT251Gjd?p=preview – Phil
謝謝@菲爾,這是最好的答案... –