Support for http interceptors
homanchou opened this issue · 8 comments
homanchou commented
App = angular.module("myApp", ["ngGrid", "ngAnimate", "ui.router", "ui.bootstrap"]);
//The following broke during grunt build
App.config(function($httpProvider) {
$httpProvider.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
$httpProvider.interceptors.push(function($q) {
....
});
$httpProvider.interceptors.push(function($q, $rootScope) {
....
});
}
]);
// we resorted to this format to get it to minify correctly
App.config([
"$httpProvider", function($httpProvider) {
$httpProvider.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
$httpProvider.interceptors.push(['$q', function($q) {
....
}]);
$httpProvider.interceptors.push(['$q','$rootScope', function($q, $rootScope) {
....
}]);
}
]);
efolio commented
+1, I just lost hours figuring this out…
fitzchak commented
+1, I also lost two hours for figuring this out...
jtammen commented
+1
olalonde commented
Oh.. thanks for this issue. I couldn't figure out what was breaking my build.
selvakn commented
👍
few more hours lost here..
akalirong commented
spending hours on this!!! please fix!!
34r7h commented
so does anyone know of any hip, angular grunt tasks that account for these trivial issues before someone like me has to be all proper with dept injections?
eddiemonge commented
Please try https://github.com/olov/ng-annotate. ngmin is now deprecated: #93
If your issue isn't resolved there please open an issue at https://github.com/olov/ng-annotate/issues
If you really want ngmin to fix this issue, feel free to fork it and use that.