我选择了带有选项的框,但是如何使用角度带来循环选项
<select class="form-control" data-ng-model="status" data-ng-change="">
<option value="cheque">Cheque No</option>
<option value="stat">Status</option>
</select>
答案 0 :(得分:0)
在控制器中添加options数组对象并使用ng-options进行选择。您可以查看here了解详情。
<button type="button" class="btn btn-default btn-primary" ng-change="change()" ng-model="status" data-html="1" ng-options="option.value as option.label for option in options" bs-select>
Action <span class="caret"></span>
</button>
app.controller('MainCtrl', function($scope) {
$scope.status = '';
$scope.options = [
{value: 'Cheque', label: 'Cheque'},
{value: 'Status', label: 'Status'}
];
$scope.change = function(){
console.log('changed to : '+$scope.status);
};
});