Quantcast
Channel: User Lalit Kale - Stack Overflow
Viewing all articles
Browse latest Browse all 30

Answer by Lalit Kale for How to substitute $httpBackend with alternate mock server?

$
0
0

You may want to try

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();        };    }]);

This way you can restore httpBackend. For more details please refer: E2E mock $httpBackend doesn't actually passThrough for me


Viewing all articles
Browse latest Browse all 30

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>