Hi
I am currently trying to implement a autocomplete textbox(when user starts typing in the textbox, based on characters entered data will be returned to the UI from the database) in using Angular JS and MVC 5. The data being returned is not the database i am connecting to through the entity framework, it is a webservice that i am calling
So <i have added my control to the pa
<label class="control-label">Customer Search</label>
<input Customer-auto-complete class="form-control" ng-model="ctrl.Customer" placeholder="enter name" type="text">
In my function, how would i make the datasource a list which is returned from a webservice call?
The webservice will be called from the customer controller through public actionresult called GetCustomers
What I have tried:
This is the function i have found and currently have implemented
function customerCtrl($scope) {
var ctrl = this;
ctrl.client ={name:'', id:''};
$scope.dataSource = [{name:'Ragnar'},{name:'Helga'},{name:'Bucky'},{name:'Renato'},{name:'Bojan'}, {name:'Ricardo'}, {name:'Oviedo'];
$scope.setClientData = function(item){
if (item){
ctrl.Customer= item;
}
}
}