I am facing an issue with my simple controller, which looks like this:
function MyController($scope, $http) {
...
$http.post(url).success(function(data) {
console.log(data)
});
}
MyController.$inject = ['$scope', '$http'];
Although everything is functioning as expected, I have encountered a problem. The JSON response that is being returned is commented out using /** */ for security purposes. In jQuery, I managed to overcome this issue by extending the $.ajax object to remove these comments and then parse the result. I am now looking for a way to achieve the same functionality in AngularJS, wherein I can instruct $http to automatically remove the comments from each response. This way, I won't have to manually type the code every time.
Do you have any suggestions on how I can accomplish this?