I am calling a wcf service using angular js, but it's not binding the data in my ui grid.Please help
Controller code-
///
///
var angular = angular.module('uigridApp', ["ui.grid"]);
angular.service("UserListingService", function ($http) {
this.getdata = function () {
var response = $http.get("http://localhost:58816/Service1.svc/SelectEDocsUserDetails");
return response;
}
});
angular.controller('uigridCtrl', function ($scope, UserListingService) {
getAlldata();
function getAlldata() {
var response = UserListingService.getdata();
response.then(function (d) {
$scope.emp = d.data;
}, function () {
alert("Error in feaching the record");
});
};
$scope.users = [{ name: "pre", age: "12", location: "jammu" },
{ name: "riya", age: "12", location: "jammu" },
{ name: "inku", age: "12", location: "jammu" }
];
$scope.gridoptions = {
// data: 'users',
data: 'emp',
showColumnFooter: true,
enableColumnresize: true
};
});
-----------------------
Html code
User Details
--------------------------------------
Mangesh GaherwarPosted Dec 18, 2017, 12:35 AM