Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was 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

Description

@jloosli

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions