I am calling a wcf service using angular js, but it's not binding the data in my ui grid.Please help
Controller code-
JavaScript
///
///
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" },
PowerShell
{ name: "inku", age: "12", location: "jammu" }
];
$scope.gridoptions = {
// data: 'users', data: 'emp',
showColumnFooter: true,
enableColumnresize: true
Code
};
});
-----------------------Html code
<!DOCTYPE html>
User Details
--------------------------------------
Mangesh Gaherwar17 pointsPosted Dec 17, 2017, 7:35 PM EST