Skip to content

Instantly share code, notes, and snippets.

@Xerosigma
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xerosigma/03cd1cc78882e6897019 to your computer and use it in GitHub Desktop.
Save Xerosigma/03cd1cc78882e6897019 to your computer and use it in GitHub Desktop.
See the output of $scope.employees in the $scope.employees file below.
// Search
Object {self: Object, search: Object}
// Employees array
Object {employees: Array[2]}
// Pages
Object {size: 20, totalElements: 2, totalPages: 1, number: 0}
// ?????
Object {then: function, catch: function, finally: function}
// Self???
true
$scope.employees = $resource("http://localhost:8080/employees").get(null, function () {
angular.forEach($scope.employees, function (employee) {
console.log(employee);
});
});
{
"_links" : {
"self" : {
"href" : "http://localhost:8080/employees{?page,size,sort}",
"templated" : true
},
"search" : {
"href" : "http://localhost:8080/employees/search"
}
},
"_embedded" : {
"employees" : [ {
"id" : "541f386fc1f879cee609bfc3",
"name" : "Bill Dunn",
"location" : [ 42.012559, -87.7672357 ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/employees/541f386fc1f879cee609bfc3"
}
}
}, {
"id" : "541f3939c1f879cee609bfc4",
"name" : "Nestor Ledon",
"location" : [ 42.0126337, -87.7672357 ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/employees/541f3939c1f879cee609bfc4"
}
}
} ]
},
"page" : {
"size" : 20,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment