mirror of
https://github.com/chsakell/aspnet-core-signalr-angular.git
synced 2025-12-22 17:27:48 +00:00
move feed service from match component
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user