user6582640 user6582640 - 1 year ago 51
AngularJS Question

$http is not a function (AngularJS)

I made sure $scope is before $http, but I'm still getting this error!

.service('Requests', function () { /* ... */ })
.controller('RequestsOffWork', ['$scope', '$stateParams', '$location',
'Authentication', '$http', 'Requests',
function ($scope, $stateParams, $location, $http, Authentication, Requests) {

Sam Sam
Answer Source

You have the parameters out of order.

'$scope', '$stateParams', '$location', 'Authentication', '$http', 'Requests'

$scope, $stateParams, $location, $http, Authentication, Requests

Switch $http and Authentication in one of the two spots.