You generally don't need to worry about this. The json filter removes those 
properties by default (I believe) and your view should know what properties 
it needs to display so it should never have to worry about those properties.

On Tuesday, December 17, 2013 9:32:00 PM UTC-8, Thai wrote:
>
> Thanks, Jeff, for the angular.(to | from)Json. So, if I want to remove all 
> the $-prefixed keys, I have to use something like 
> angular.fromJson(angular.toJson(temp)), right?
>
> This might be a problem if I want to display the content of the variable 
> temp on the screen.
>
>
> On Tue, Dec 17, 2013 at 11:58 PM, Jeff Hubbard <[email protected]<javascript:>
> > wrote:
>
>> Just curious, but why is this a problem? Also, angular.(to|from)Json 
>> handle this case for you by taking out $-prefixed properties.
>>
>>
>> On Tuesday, December 17, 2013 7:58:29 PM UTC-8, Thai wrote:
>>>
>>> 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 a topic in the 
>> Google Groups "AngularJS" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/angular/VhuN26UDCHY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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