@@ -253,58 +253,6 @@ function lookupDottedPath(obj, path) {
253
253
});
254
254
});
255
255
</pre>
256
-
257
- * # Buzz client
258
-
259
- Let's look at what a buzz client created with the `$resource` service looks like:
260
- <doc:example>
261
- <doc:source jsfiddle="false">
262
- <script>
263
- function BuzzController($resource) {
264
- this.userId = 'googlebuzz';
265
- this.Activity = $resource(
266
- 'https://www.googleapis.com/buzz/v1/activities/:userId/:visibility/:activityId/:comments',
267
- {alt:'json', callback:'JSON_CALLBACK'},
268
- {
269
- get:{method:'JSONP', params:{visibility:'@self' }},
270
- replies: {method:'JSONP', params:{visibility:'@self', comments:'@comments' }}
271
- }
272
- );
273
- }
274
-
275
- BuzzController.prototype = {
276
- fetch: function() {
277
- this.activities = this.Activity.get({userId:this.userId});
278
- },
279
- expandReplies: function(activity) {
280
- activity.replies = this.Activity.replies({userId:this.userId, activityId:activity.id});
281
- }
282
- };
283
- BuzzController.$inject = ['$resource'];
284
- </script>
285
-
286
- <div ng-controller="BuzzController">
287
- <input ng-model="userId"/>
288
- <button ng-click="fetch()">fetch</button>
289
- <hr/>
290
- <div ng-repeat="item in activities.data.items">
291
- <h1 style="font-size: 15px;">
292
- <img src="{{item.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
293
- <a href="{{item.actor.profileUrl}}">{{item.actor.name}}</a>
294
- <a href ng-click="expandReplies(item)" style="float: right;">Expand replies:
295
- {{item.links.replies[0].count}}</a>
296
- </h1>
297
- {{item.object.content | html}}
298
- <div ng-repeat="reply in item.replies.data.items" style="margin-left: 20px;">
299
- <img src="{{reply.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
300
- <a href="{{reply.actor.profileUrl}}">{{reply.actor.name}}</a>: {{reply.content | html}}
301
- </div>
302
- </div>
303
- </div>
304
- </doc:source>
305
- <doc:scenario>
306
- </doc:scenario>
307
- </doc:example>
308
256
*/
309
257
angular . module ( 'ngResource' , [ 'ng' ] ) .
310
258
factory ( '$resource' , [ '$http' , '$q' , function ( $http , $q ) {
0 commit comments