Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $httpProvider.interceptors.push(function(){
- return {
- 'request': function(request) {
- // same as above
- if(request.data){
- if(request.data.constructor === Array){
- angular.forEach(request.data, function(obj){
- delete obj['UI'];
- });
- }else if(typeof request.data == 'object'){
- delete request.data['UI'];
- }
- }
- return request;
- },
- 'response': function(response) {
- // same as above
- if(response.data){
- if(response.data.constructor === Array){
- angular.forEach(response.data, function(obj){
- obj.UI = {};
- });
- }else if(typeof response.data == 'object'){
- response.data.UI = {};
- }
- }
- return response;
- }
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement