When I do a $http.post
in AngularJS with a object like:
{ name: \'232\', id: \'3434\', $type: \"API.Models.Fields.ValuesList, API\" }
Yes, Angular strips dollar-prefixed properties when sending data over $http
service.
$http service serialises objects to JSON string using angular.toJson
method. This method strips
properties with leading $ characters because angular uses this notation internally (e.g. instance method $save
is available on all ngResource
objects).
Quick workaround is to stringify the data manually (using JSON.stringify), before passing it on to $http
:
$http.post('/api/path', JSON.stringify(model));