]>
Commit | Line | Data |
---|---|---|
22a16e36 C |
1 | import { Component, OnInit } from '@angular/core' |
2 | import { NotificationsService } from 'angular2-notifications' | |
3 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | |
5 | import { UserSubscriptionService } from '@app/shared/user-subscription' | |
6 | ||
7 | @Component({ | |
8 | selector: 'my-account-subscriptions', | |
9 | templateUrl: './my-account-subscriptions.component.html', | |
10 | styleUrls: [ './my-account-subscriptions.component.scss' ] | |
11 | }) | |
12 | export class MyAccountSubscriptionsComponent implements OnInit { | |
13 | videoChannels: VideoChannel[] = [] | |
14 | ||
15 | constructor ( | |
16 | private userSubscriptionService: UserSubscriptionService, | |
17 | private notificationsService: NotificationsService, | |
18 | private i18n: I18n | |
19 | ) {} | |
20 | ||
21 | ngOnInit () { | |
22 | this.userSubscriptionService.listSubscriptions() | |
23 | .subscribe( | |
24 | res => { console.log(res); this.videoChannels = res.data }, | |
25 | ||
26 | error => this.notificationsService.error(this.i18n('Error'), error.message) | |
27 | ) | |
28 | } | |
29 | ||
30 | } |