Hi All,
I'm learning angularjs 1.2.5 and this is what I notice:
html: <button ng-click="testJAXRS()">testing jax-rs with ng-click</button>
js:
var app = angular.module("myApp", ["ngResource"]);
app.controller("Controller", ["$scope", "$resource", function($scope, $resource) {
$scope.testJaxRS = $resource("${pageContext.request.contextPath}/resource/test-jaxrs/something");
$scope.testJAXRS = function() {
var temp = $scope.testJaxRS.get(function() {
alert(JSON.stringify(temp));
});
};
}]);
The json string returned from the server is {"key 1":["value 1 for key1","value 2 for key1"],"xyz":["abc","def","mnp","something"]}, but the alert prints out {"key 1":["value 1 for key1","value 2 for key1"],"xyz":["abc","def","mnp","something"],"$promise":{},"$resolved":true}. Is there any way to not have the "$promise" and "$resolved" keys in the variable temp?
Thanks.