Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f852967

Browse files
Di Pengvojtajina
Di Peng
authored andcommitted
Updated docs/cookbook/buzz from gdocs
With couple of fixes: * indentation + code formatting * use ng:href, ng:src * change UserId to misko.hevery so it will work now
1 parent e83465c commit f852967

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

docs/content/cookbook/buzz.ngdoc

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,47 +16,46 @@ to retrieve Buzz activity and comments.
1616
<doc:source>
1717
<script>
1818
BuzzController.$inject = ['$resource'];
19-
function BuzzController($resource){
19+
function BuzzController($resource) {
2020
this.Activity = $resource(
2121
'https://www.googleapis.com/buzz/v1/activities/:userId/:visibility/:activityId/:comments',
22-
{alt:'json', callback:'JSON_CALLBACK'},
23-
{ get: {method:'JSON', params:{visibility:'@self'}},
24-
replies: {method:'JSON', params:{visibility:'@self', comments:'@comments'}}
22+
{alt: 'json', callback: 'JSON_CALLBACK'},
23+
{ get: {method: 'JSON', params: {visibility: '@self'}},
24+
replies: {method: 'JSON', params: {visibility: '@self', comments: '@comments'}}
2525
});
2626
}
2727
BuzzController.prototype = {
28-
fetch: function(){
28+
fetch: function() {
2929
this.activities = this.Activity.get({userId:this.userId});
3030
},
3131
expandReplies: function(activity) {
32-
activity.replies =
33-
this.Activity.replies({userId:this.userId, activityId:activity.id});
32+
activity.replies = this.Activity.replies({userId: this.userId, activityId: activity.id});
3433
}
3534
};
3635
</script>
3736
<div ng:controller="BuzzController">
38-
<input name="userId" value="googlebuzz"/>
37+
<input name="userId" value="misko.hevery"/>
3938
<button ng:click="fetch()">fetch</button>
4039
<hr/>
4140
<div class="buzz" ng:repeat="item in activities.data.items">
4241
<h1 style="font-size: 15px;">
43-
<img src="{{item.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
44-
<a href="{{item.actor.profileUrl}}">{{item.actor.name}}</a>
45-
<a href="" ng:click="expandReplies(item)" style="float: right;">
42+
<img ng:src="{{item.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
43+
<a ng:href="{{item.actor.profileUrl}}">{{item.actor.name}}</a>
44+
<a href ng:click="expandReplies(item)" style="float: right;">
4645
Expand replies: {{item.links.replies[0].count}}
4746
</a>
4847
</h1>
4948
{{item.object.content | html}}
5049
<div class="reply" ng:repeat="reply in item.replies.data.items" style="margin-left: 20px;">
51-
<img src="{{reply.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
52-
<a href="{{reply.actor.profileUrl}}">{{reply.actor.name}}</a>:
50+
<img ng:src="{{reply.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
51+
<a ng:href="{{reply.actor.profileUrl}}">{{reply.actor.name}}</a>:
5352
{{reply.content | html}}
5453
</div>
5554
</div>
5655
</div>
5756
</doc:source>
5857
<doc:scenario>
59-
it('fetch buzz and expand', function(){
58+
it('fetch buzz and expand', function() {
6059
element(':button:contains(fetch)').click();
6160
expect(repeater('div.buzz').count()).toBeGreaterThan(0);
6261
element('.buzz a:contains(Expand replies):first').click();

0 commit comments

Comments
 (0)