Rene Rene - 4 months ago 11
jQuery Question

Angular JS populate Select Bootstrap

I have the following array

$scope.profissionais = {}


I have the following array

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


I'm trying populates it with the following code

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


However it did not work but also not give any error, akguem help me? TKS

Answer

ng:repeat to 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>
Comments