Hello,
I'm trying to associate arbitrary data with object created by a $resource,
but want to avoid them being sent in the json automatically.
With help from SO chat, I've learned that setting a property with
Object.setProperty(*object*, *propertyName, { value: 'value goes here',
enumerable: false}); *the property will still be present, but
Json.Stringify() will ignore it.
I've tried extending $resource in such a way that it automatically adds an
empty "data" property (value: {}) to the objects it creates, but not sure
how to approach this.
Are there alternative ways, or could anyone guide me in how to extend the
resource function so that upon calling it with new , it adds the empty data
property?
I made a fiddle with what I have:
http://jsfiddle.net/q3481rbb/
Thanks in advance!
--
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.