Angular JS填充Select Bootstrap

时间:2016-07-05 21:44:56

标签: javascript jquery angularjs

我有以下数组

$scope.profissionais = {}  

我有以下数组

[{"usuario":"14","username":"Renê Lima"},{"usuario":"16","username":"Thaís"}]

我尝试使用以下代码填充

<option ng:repeat="prof in profissionais" value="{{prof.usuario}}">
    {{prof.username}}
</option>

然而它不起作用但也没有给出任何错误,akguem帮帮我? TKS

1 个答案:

答案 0 :(得分:0)

ng:重复到ng-repeat:)

$scope.singleSelect = null
$scope.profissionais = [
  {usuario:"14",username:"Renê Lima"},    
  {usuario:"16",username:"Thaís"}
];

<select ng-model="singleSelect">
  <option ng-repeat="prof in profissionais" ng-value="prof.usuario">{{prof.username}}</option>
</select>