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.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to