ok i am having issues returning the data to html. here is my code.

<input type="text" ng-model="userEntry" typeahead-template-url
="searchResults.html"

uib-typeahead="data.EMPLOYEE_NAME for data in search($viewValue)" 
uib-typeahead-wait-ms="500"/>

<script type="text/ng-template" id="searchResults.html">

<div>

<div>

*{{*match.model.EMPLOYEE_NAME*}}*

</div>

</div>

</script>

--------------------------------------------------------------------------------


App.factory('SearchService', ['$http','$q', function ($http,$q) {
    var url = '/api/GetUsers';

    var deffered = $q.defer();
    var data = [];
    var myService = {};

    myService.async = function () {
        $http.get(url)
        .success(function (d) {
            data = d;
            //console.log(d);
            deffered.resolve();
        });
        return deffered.promise;
    };
    myService.data = function () { return data; };

    return myService;

   
}]);


------------------controller-----------------------------------------------------------


App.controller('SearchUser', ['$scope', 'SearchService', function ($scope, 
SearchService) {
    
 
    $scope.search = function (val) {
        SearchService.async().then(function () {
            $scope.data = SearchService.data();
            console.log($scope.data);
        });
    }

    
}
]);

----------------------------------------------------------------here is my 
data coming back but will not load back into the text box for some reason...


 
[{"EMPLOYEE_ID":"246","NETWORK_ID":"onky","EMPLOYEE_NAME":"Aaron","DIRECTOR_NAME":"Blood","VP_NAME":"Sigi"},
{"EMPLOYEE_ID":"802","NETWORK_ID":"c0","EMPLOYEE_NAME":"Georges","DIRECTOR_NAME":"Johnson","VP_NAME":"Sigi"},
"},{"EMPLOYEE_ID":"124","NETWORK_ID":"abr","EMPLOYEE_NAME":"Maryam 
J.","DIRECTOR_NAME":"James","VP_NAME":"Sigi"}]



-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to