0

When adding ngMock in dependency injection The login.html page is not loaded

var backendMock = angular.module('backendMock',['ngMock']);

enter image description here

removing it from dependency and its working fine

var backendMock = angular.module('backendMock',[]);

enter image description here

Shubham
  • 189
  • 9
  • That's expected. ngMock is used to mock $httpBackend in unit tests. You're not supposed to use it in your application. Read https://docs.angularjs.org/api/ngMock/service/$httpBackend – JB Nizet Apr 06 '16 at 05:56
  • so I can use $httpBackend only for testing ?? – Shubham Apr 06 '16 at 06:00
  • 1
    There are three $httpBackend: one in the core ng module, that isn't supposed to be used in client code, one in the ngMock module, for unit tests, and one in ngMockE2E, for "end-to-end" tests where the backend must be mocked (or when you need to develop the frontend and the backend doesn't exist yet). What are you trying to achieve? Why do you think you need to add ngMock to your app? – JB Nizet Apr 06 '16 at 06:02
  • @JBNizet thanks thats what i needed actually . I though I can use any one of the module to mock a backend that was really helpfull. my backend is not ready yet and I need to test my front end. – Shubham Apr 06 '16 at 06:05
  • Then you need mockE2E. But you'll need to configure it to let it "passThrough" for requests to static html templates. – JB Nizet Apr 06 '16 at 06:07

0 Answers0