当我使用静态方式显示所有按钮收音机时,它工作正常(100%宽度),但使用 ng-repeat 的动态问题我有换行符。< / p>
没有ng-repeat:
使用ng-repeat:
代码段:
<div class="btn-group input-group btn-group-justified" ng-repeat="number in numbers">
<label class="btn btn-primary" ng-model="radioModel" btn-radio="'{{number}}'">{{number}}</label>
</div>
答案 0 :(得分:3)
http://plnkr.co/edit/LFiWKeAdL5FMDrRmpLoP?p=preview
将ng-repeat移至<label>
<div class="btn-group input-group btn-group-justified">
<label class="btn btn-primary" ng-model="model.radioModel" btn-radio="{{number}}" ng-repeat="number in numbers" ng-init="model =$parent" name="radio">{{number}}</label>
</div>