angularjs - angular $resource GET item is generating wrong api request -
whenever i'm calling item in angular api url not expect, , can't find wrong it.
my resource
angular.module('app').factory('mvcourse', function($resource) { var courseresource = $resource('/api/courses/:id', {_id: "@id"}); return courseresource; });
which can see expect call http://localhost/api/courses/53f05bb649d473da3fb83b59
getting http://localhost:1337/api/courses?_id=53f05bb649d473da3fb83b59
my api call follow
angular.module('app').controller('mvcoursedetailctrl', function ($scope,$routeparams,mvcourse) { $scope.course = mvcourse.get({_id:$routeparams.id}); });
i'm using
"angular-resource": "~1.2.21", "angular": "~1.2.21",
it seems changing _id
id
trick, found in in comments
Comments
Post a Comment