Created
December 10, 2015 16:01
-
-
Save gabteles/23ccc4374cf1ba33cb7d to your computer and use it in GitHub Desktop.
Filters sensitive data from Angular's $http responses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Filters sensitive data from Angular's $http responses. | |
* | |
* @author Gabriel Teles <[email protected]> | |
* @version 0.1.0 | |
* @since 2015.12.10 | |
*/ | |
(function() { | |
'use strict'; | |
Promise.prototype.filterSensitiveData = function() { | |
var self = this; | |
return new Promise(function(resolve, reject) { | |
self.then(function(response) { | |
resolve(response.data); | |
}, function(response) { | |
reject(response.data); | |
}); | |
}); | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment