I am using select2 the way it is specified in https://github.com/angular-ui/ui-select2
<div ng-controller="sampleController>
<select ui-select2 ng-model="select2" data-placeholder="Pick a number">
<option value=""></option>
<option ng-repeat="number in range" value="{{number.value}}">{{number.text}}</option>
</select>
</div>
But this is not working for me. I see the dropdown but there are no values to select.
If I change it to have static list as follow then it works fine.
<div ng-controller="sampleController">
<select ui-select2 ng-model="select2" data-placeholder="Pick a number">
<option value="">value1</option>
<option value="">value2</option>
<option value="">value3</option>
</select>
</div>
What am I missing here?
My model is as follow
function sampleController($scope){
$scope.select2="";
$scope.range=[{text:"name1", value:"id1"},
{text:"name2", value:"id2"},
{text:"name3", value:"id3"}];
$("#e1").select2();
}
$scope.range? Also, did you includeng-controllercorrectly?