user6582640 user6582640 - 1 year ago 73
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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download