Typeerror: Cannot Read Property 'get' Of Undefined
Solution 1:
As other commenters said you should look at your controller declaration, you need to 'inject' the $http service:
angular.module('myApp')
.controller('messageController', ['$scope', '$http', function($scope, $http){
$http.get()
.success()
.error();
}]);
Solution 2:
As I do not see any controller code, I would have to assume one out of the following could be causing this issue,
You don't have all the dependencies injected in your controller as the commentators and @Plato has pointed out. Check this -> TypeError: Cannot call method 'get' of undefined
You have injected all the dependencies but do not match the order, e.g., what should be
['$scope', '$http', function($scope, $http)
, you would have mentioned like this['$scope', '$http', function($http, $scope)
. When using the array notation for injecting dependencies, the order of the arguments is important. Check this -> AngularJS $http.get returns undefined and $http() is not a function
Post a Comment for "Typeerror: Cannot Read Property 'get' Of Undefined"