Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

angular.toJson() strips out keys with "$" as the beginning character #5841

Closed
jloosli opened this issue Jan 16, 2014 · 1 comment
Closed

Comments

@jloosli
Copy link

jloosli commented Jan 16, 2014

I can understand why angular strips out keys with "$" as the first character when displaying an object so that it can pull out things like $q, when a result is displayed. However, it's recently caused an issue for me when trying to connect to the rest api of Mongolab when trying to send something like

{$push: {tags: {'red'}}}

as the request object. When actually getting sent, the request object comes across as {}. Keys like $set and $push are actually necessary when working with MongoDB. This happens in the toJsonReplacer function which is called within $http. I can get past this by calling JSON.stringify() myself on the object before sending the request, but I'm wondering if it would be best to disable the stripping of the ${key} values for $http requests.

@caitp
Copy link
Contributor

caitp commented Jan 16, 2014

Dupe of #1463 --- If I recall correctly (and I don't, necessarily), I think this was decided to be tackled in 1.3, but I don't have the full notes from that meeting

@caitp caitp closed this as completed Jan 16, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants