BuzzController = ($resource) ->
@userId = 'googlebuzz'
@Activity = $resource 'https://www.googleapis.com/buzz/v1/activities/:userId/:visibility/:activityId/:comments',
{alt: 'json', callback: 'JSON_CALLBACK'},
{get:{method:'JSONP', params:{visibility:'@self'}}, replies: {method:'JSONP', params:{visibility:'@self', comments:'@comments'}}}
# :: = 一次向prototype加入多个成员。
# 原来可以象这样一次性定义多个progotype成员。
BuzzController:: =
fetch: -> @activities = @Activity.get userId:@userId
expandReplies: (activity) -> activity.replies = @Activity.replies userId:@userId, activityId:activity.id
module.controller 'BuzzController', ['$resource', BuzzController]