Answer the question
In order to leave comments, you need to log in
Angular, $save() method. How to prevent angular internal methods ($promise, $resolve etc) from being forwarded along with post?
Good afternoon! There is this code:
$scope.invoice = Invoices.get({invoiceId: '1'})
$scope.invoice.test = 'test';
$scope.invoice.$save();
Answer the question
In order to leave comments, you need to log in
By default, Angular passes the data through the defaults.transformRequest function before sending it.
Check up can somewhere changed this function in $http configs.
// transform outgoing request data
transformRequest: [function(d) {
return isObject(d) && !isFile(d) ? toJson(d) : d;
}]
function toJson(obj, pretty) {
if (typeof obj === 'undefined') return undefined;
return JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null);
}
function toJsonReplacer(key, value) {
var val = value;
if (typeof key === 'string' && key.charAt(0) === '$') {
val = undefined;
} else if (isWindow(value)) {
val = '$WINDOW';
} else if (value && document === value) {
val = '$DOCUMENT';
} else if (isScope(value)) {
val = '$SCOPE';
}
return val;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question