I'm trying to use some basic functions of the $resource service. Here's
what I'm trying to do (inside a controller)
[code]
$scope.res = $resource("/path/to/res").get();
$scope.clicked = function() {
console.log($scope.res);
$scope.res.$save();
}
[/code]
The get() part works fine -- I get the resource no problem.
The $scope.res object properties are bound via ng-model to input elements.
The $scope.clicked function is fired by clicking on a button element.
When the clicked function fires, the log looks fine; i.e. it logs something
like
[code]
f {$promise: Object, $resolved: true, id: "9", name: "John"...}
[/code]
But....the $save() part generates a POST request, but the Content-Length is
zero, and I don't see any request data.
>From the docs and other examples I've seen, this looks like one of the
simplest use-cases of $resource.
Anyone see what I'm missing?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.