我正在使用ng-repeat指令中的引導程序單選按鈕。但是,這些更改不會傳播到基礎模型。這是代碼:ng-repeat指令中的引導程序收音機
<a href="#" class="btn btn-primary" ng-click="data.list.push({ value: 1 })">Add Item</a>
<div class="alert alert-info">
<div ng-repeat="item in data.list track by $index">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-sm btn-default"><input type="radio" data-ng-model="item.value" value="1">1</label>
<label class="btn btn-sm btn-default"><input type="radio" data-ng-model="item.value" value="2">2</label>
</div> {{ item.value }}
</div>
</div>
同樣的例子工作時,只要我刪除的按鈕組,並用這樣的普通單選按鈕代替它:
<a href="#" class="btn btn-primary" ng-click="data2.list.push({ value: 1 })">Add Item</a>
<div class="alert alert-info">
<div ng-repeat="item in data2.list track by $index">
<input type="radio" data-ng-model="item.value" value="1">
<input type="radio" data-ng-model="item.value" value="2">
{{ item.value }}
</div>
</div>
我已經建立了plunkr:http://plnkr.co/edit/ROLW8lluX6DrM3w2UUlH?p=preview