I am using AngularJs + Select2. I am trying to get the data from remote. Below is my code
HTML :
<div class="col-md-4 left">
<input type="text" style="width:300px" ui-select2="multi" ng-model="multi2Value" multiple="multiple" />
</div>
JS : [UPDATED]
$scope.multi = {
ajax: {
headers: { 'Content-Type': 'application/json' },
url: "http://localhost:63591/Lookup?lookup=Lookup&key=acc",
data: function (term, page) {
return {};
},
results: function (data, page) {
console.log(data);
return {results: data.LookupValue};
}
}
And my response will be
{ "LookupValue" : [ "AAAA","BBBB","CCC" ] }
But in the console i am seeing the response. But it is not loading into the select dropdown.
What went wrong in my code. Can anyone plz help me ? Thanks
return data.LookupValue;