Currently working on a RESTful single page application with AngularJS, I have encountered an issue despite following the recommended code structure:
bosApp.factory('Revision', function($resource, $http) {
return $resource('http://example.com/api/v1/articlerevision/:id/', {
id: '@is'
},
{
update: {
method: 'POST',
params: {"update": true},
isArray: false
},
save: {
method: 'PUT'
},
query: {
method: 'GET',
isArray: true,
transformResponse: tastypieDataTransformer($http)
},
create: {
method: 'POST'
}
}
);
});
var CreateCtrl = function($scope, $location, Revision) {
$scope.save = function() {
Revision.create($scope.revision);
$location.path('/revision-list');
};
};
Despite following the prescribed methods, when checking the network tab, I am encountering an unexpected issue where the method is showing as options
instead of post
. The status appears as load cancelled
and type is marked as pending
. What could be causing this discrepancy and how can it be resolved?