Dear all,

I know that variables that starts with $$ are exclude from serialization, 
I'd like to use them for some properties.
My REST API have HATEOAS enabled, so when I get a resource I can easily 
resolve some associations.
My idea is to transform 
{
    "id":1234,
    "name":"War and peace",
    links : [{"rel":"author", "href":"http://api.acme.com/authors/123"}]
}

into 
{
    "id":1234,
    "name":"War and peace",
    "$$author":{"name":"Leon Tolstoi" /*other properties*/}
}

I don't want the author to be send in a REST PUT request because the 
deserialisation would fails (there is no "author" property in the scala 
object on the server side), so I added $$ and it works. 

But is it an official feature or a hack ? The doc says "*Properties with 
leading $$ characters will be stripped since angular uses this notation 
internally.*", something between "don't use $$ notation" and "use $$ 
notation if you don't want a field to be serialized".

It seems quite reliable because I don't think AngularJS team will not stop 
using $$ soon for internal variable that are not meant to be serialized, 
but if it is an official feature it would be even better.

Many thanks,

- A

-- 
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/d/optout.

Reply via email to