move feed service from match component

This commit is contained in:
chsakell
2016-10-04 14:57:37 +03:00
parent fb6127d281
commit fdcae26d63
6 changed files with 34 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
<div class="row">
<div class="col-md-4" *ngFor="let match of matches">
<match [match]="match"></match>
<match [match]="match" (updateSubscription)="updateSubscription($event)"></match>
</div>
<div class="col-md-4">
<chat [matches]="matches"></chat>

View File

@@ -73,4 +73,11 @@ export class HomeComponent implements OnInit {
console.log(error);
});
}
updateSubscription(subscription: any) {
if(<boolean>subscription.subscribe === true)
this.feedService.subscribeToFeed(<number>subscription.matchId);
else
this.feedService.unsubscribeFromFeed(<number>subscription.matchId);
}
}