user6582640 user6582640 - 4 months ago 8
AngularJS Question

$http is not a function (AngularJS)

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

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

Sam Sam
Answer

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.