AngularJs ReferenceError: $http is not defined

I have the following Angular function: $scope.updateStatus = function(user) { $http({ url: user.update_path, method: “POST”, data: {user_id: user.id, draft: true} }); }; But whenever this function is called, I am getting ReferenceError: $http is not defined in my console. Can someone help me understanding what I am doing wrong here? 3 Answers 3

How can I post data as form data instead of a request payload?

In the code below, the AngularJS $http method calls the URL, and submits the xsrf object as a “Request Payload” (as described in the Chrome debugger network tab). The jQuery $.ajax method does the same call, but submits xsrf as “Form Data”. How can I make AngularJS submit xsrf as form data instead of a … Read more