aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmir H. Hajizamani2013-01-14 19:35:31 +0000
committerBrian Ford2013-01-18 00:49:41 -0500
commit4f5583465a03ad032416b655be4450138d852d4c (patch)
tree46d8e36a7e26b9a660d83e143d55c3102428c271
parent75487ec933fb82702eeb0c65bd5f13ad9f07fbaf (diff)
downloadangular.js-4f5583465a03ad032416b655be4450138d852d4c.tar.bz2
docs(cookbook): change prototype methods to scope methods in Buzz
As explained in 'Understanding the Controller Component', Controllers written for new (post 1.0 RC) versions of Angular need to add methods to the scope directly, not the function's prototype. Correcting this example should remove any ambiguity, especially for beginners.
-rw-r--r--docs/content/cookbook/buzz.ngdoc10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/content/cookbook/buzz.ngdoc b/docs/content/cookbook/buzz.ngdoc
index baed4646..00db35cf 100644
--- a/docs/content/cookbook/buzz.ngdoc
+++ b/docs/content/cookbook/buzz.ngdoc
@@ -21,12 +21,12 @@ to retrieve Buzz activity and comments.
{ get: {method: 'JSONP', params: {visibility: '@self'}},
replies: {method: 'JSONP', params: {visibility: '@self', comments: '@comments'}}
});
- }
- BuzzController.prototype = {
- fetch: function() {
+
+ $scope.fetch = function() {
$scope.activities = $scope.Activity.get({userId:this.userId});
- },
- expandReplies: function(activity) {
+ }
+
+ $scope.expandReplies = function(activity) {
activity.replies = $scope.Activity.replies({userId: this.userId, activityId: activity.id});
}
};