After reading the AngularJS document fo $httpBackend, I am still not very clear what the difference between $httpBackend.expect
and $httpBackend.when
as both are functions for mocking http requests.
Could someone help explain the difference between these two functions? And also when shall I use $httpBackend.when
instead of $httpBackend.expect
?