I have a factory that returns a JSON object using $resource.get
request but I cannot get some data from my ngresource factory:
HTML
<body ng-app="myApp" ng-controller="myCtrl" >
<table border="1">
<tr>
<th>Name</th>
<th>city</th>
</tr>
<tr ng-repeat="x in data.records">
<td style="padding: 20px">{{records.Name}}</td>
<td style="padding: 20px">{{records.City}}</td>
</tr>
</table>
</body>
JS:
angular.module('myApp',['ngResource']);
angular.module('myApp').controller("myCtrl",function (yourService,$scope) {
});
angular.module('myApp').
factory('yourService', ["$resource", function($resource,$scope){
return $resource("http://www.w3schools.com/angular/customers.php").get().$promise
.then (function (data){
});
return data;
}]);