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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -