A
A
Abc Edc2015-05-31 18:17:18
Angular
Abc Edc, 2015-05-31 18:17:18

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

1 answer(s)
S
Sergey Nikolaev, 2015-06-01
@Devastor

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 question

Ask a Question

731 491 924 answers to any question