I have a factory resource with a POST method called update:
PnrApp.factory('Feed', function ($resource, $cacheFactory, $q, $rootScope) { var Feed = $resource('api/feeds/:post', { post: 'post' }, { get: { method:'GET' }, update: { method: 'POST' } }); return Feed;
});
When I call the method, it sends data to the server as expected:
$rootScope.toggleStar = function (post, feedname) { var updated = Feed.update(post); this.child.StarId = updated.StarId; }
And the server will return the correct values ββ(note the StarId in this json):
{"Name":"13 Ways to Act Like A Business Owner","ItemDate":"June 6, 2013","Url":"/post/13-Ways-to-Act-Like-A-Business-Owner-Stop-Acting-Like-an-Advisor-All-the-Time-(6-min-03-sec).aspx","StarImg":"bulletstar-on.png","StarId":1324,"StarDate":"0001-01-01T00:00:00","FeedCount":0,"FeedId":19,"SourceIcon":null,"IsBroken":false,"ItemId":"01"}
However, if you look at the updated var value for StarId, notice how it is "0":


Can someone explain why this is so, and how can I get the return values ββin this situation?