I was looking at this answer: https://stackoverflow.com/a/26992327/16584 and was trying to understand why the config
section is needed.
angular.module('httpReal', ['ng'])
.config(['$provide', function($provide) {
$provide.decorator('$httpBackend', function() {
return angular.injector(['ng']).get('$httpBackend');
});
}])
.service('httpReal', ['$rootScope', function($rootScope) {
this.submit = function() {
$rootScope.$digest();
};
}]);
It doesn't seem to work for me without it, but I don't actually understand why it would be needed since we are never replacing httpBackend
in the first place?