Answer the question
In order to leave comments, you need to log in
Error at httpBackend, what is suddenly wrong?
not at all obvious to me
Uncaught TypeError: $httpBackend.when is not a functio
$stateProvider
.state('user', {
url: '/user/:id',
controller: 'Profile',
controllerAs: 'vm',
templateUrl: 'app/user/templates/profile.html'
});
var service = {
getAll: getAll
};
return service;
function getAll(data) {
var url = '/user/' + data.userID;
return $http({
url: url,
method: "GET"
})
.then(complete)
.catch(function (message) {
$location.url('/');
});
}
$httpBackend.whenGET('/user/:id').respond(200, {message: "Hello world"});
Answer the question
In order to leave comments, you need to log in
It was worth visiting the AngularJS branch, and here you are!
On the question: it is not clear in which part of the code $httpBackend is called, and what can cause the error
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question