From 69c9266c7ca3987cb81d3bcab0fa17cfb05ee3a0 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 6 Jun 2014 07:40:15 -0700 Subject: [PATCH 1/2] Fixes code example in docs http://screencast.com/t/xHi1XoYcTJ --- src/ngResource/resource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 99eba72e6f15..e3105fd38f75 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -179,7 +179,7 @@ function shallowClearAndCopy(src, dst) { * read, update, delete) on server-side data like this: * ```js * var User = $resource('/user/:userId', {userId:'@id'}); - * var user = User.get({userId:123}, function() { + * var user = User.get({userId:123}, function(user) { * user.abc = true; * user.$save(); * }); From b214dc561a2273c553442d9770c399ee5e228ff4 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 7 Jun 2014 01:31:12 -0700 Subject: [PATCH 2/2] Update resource.js Added sentence detailing why the success callback has access to the resource assigned in the request. --- src/ngResource/resource.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index e3105fd38f75..d557c4662d51 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -179,7 +179,7 @@ function shallowClearAndCopy(src, dst) { * read, update, delete) on server-side data like this: * ```js * var User = $resource('/user/:userId', {userId:'@id'}); - * var user = User.get({userId:123}, function(user) { + * var user = User.get({userId:123}, function() { * user.abc = true; * user.$save(); * }); @@ -191,7 +191,9 @@ function shallowClearAndCopy(src, dst) { * usually the resource is assigned to a model which is then rendered by the view. Having an empty * object results in no rendering, once the data arrives from the server then the object is * populated with the data and the view automatically re-renders itself showing the new data. This - * means that in most cases one never has to write a callback function for the action methods. + * means that in most cases one never has to write a callback function for the action methods. + * Callbacks are evaluated in the same context as the initiating action method, providing access + * to objects returned in the request. * * The action methods on the class object or instance object can be invoked with the following * parameters: