diff options
| author | Misko Hevery | 2010-07-22 11:18:32 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-07-22 11:18:32 -0700 |
| commit | 849a05b5a578f19ddc3d24dc9fbd304e0e07612a (patch) | |
| tree | 3e32e2ab7b8c1ed3f53e5b568990070b5edab4fa /example/buzz/buzz.js | |
| parent | b5bbfaeb80c3f89c65d14c72cff6f0e1c8aa497a (diff) | |
| download | angular.js-849a05b5a578f19ddc3d24dc9fbd304e0e07612a.tar.bz2 | |
added jsonp to resources
Diffstat (limited to 'example/buzz/buzz.js')
| -rw-r--r-- | example/buzz/buzz.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/example/buzz/buzz.js b/example/buzz/buzz.js new file mode 100644 index 00000000..871982d7 --- /dev/null +++ b/example/buzz/buzz.js @@ -0,0 +1,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}); + } +}; |
