javascript - Angularjs : fitlering json properties to be send in a request -


is there anyway tell angularjs ( $http service) not send properties json object when doing http post?

let's have object definition :

 $scope.tobesaved = { id : 1,    name: myname,    someattributetobefiltered : 1233459,     } 

is there anyway filter someattributetobefiltered not send during $http.post(url,$scope.tobesaved) call?

thanks in advance

this remove given property on every request made via $http.

.config(['$httpprovider', function($httpprovider ) {     $httpprovider.defaults.transformrequest = [function(data)     {         if(typeof data === "object")         {             var tosend = angular.copy(data);             delete tosend.someattributetobefiltered;             return tosend;          }         else{             return data;         }     }];  }]); 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -