I am trying to use the angular $ http.patch () function to call the URl API As recommended by these answers - 1 and 2 I set the Content-Type headers in the / json application in config.
But still I get the error:
undefined is not a function
Am I missing something? Below is my code where the error occurs (Note: I entered $ http in my service in my service and other methods GET, POST, PUT, DELETE work fine):
deleteAll: function (data) {
url = $rootScope.config.api.stack.add_stack;
return $http.patch(url,angular.toJson(data));
}
AngularJs Version: v1.2.16
Even I tried using the latest version of angularjs, but still didn’t bite
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
source
share