blob: 871982d7b4a0ea7afbce24446480a02a246a13e2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
angular.service('myApplication', function($resource){
this.Activity = $resource(
'https://www.googleapis.com/buzz/v1/activities/:userId/:visibility/:activityId/:comments',
{alt:'json', callback:'JSON_CALLBACK'},
{
get: {method:'JSON', params:{visibility:'@self'}},
replies: {method:'JSON', params:{visibility:'@self', comments:'@comments'}}
});
}, {inject:['$resource']});
function BuzzController(){
this.$watch('$location.hashPath', this.userChange);
}
BuzzController.prototype = {
userChange: function(){
this.userId = this.$location.hashPath;
this.activities = this.Activity.get({userId:this.userId});
}
};
|