2019-08-25 08:37:54 +02:00
|
|
|
import { Component, OnInit, OnDestroy } from '@angular/core';
|
|
|
|
import { Subscription } from 'rxjs';
|
|
|
|
|
|
|
|
import { ScheduledStatusService, ScheduledStatusNotification } from '../../../services/scheduled-status.service';
|
2019-08-25 07:43:47 +02:00
|
|
|
|
|
|
|
@Component({
|
2019-08-25 08:37:54 +02:00
|
|
|
selector: 'app-scheduled-statuses',
|
|
|
|
templateUrl: './scheduled-statuses.component.html',
|
|
|
|
styleUrls: ['./scheduled-statuses.component.scss']
|
2019-08-25 07:43:47 +02:00
|
|
|
})
|
2019-08-25 08:37:54 +02:00
|
|
|
export class ScheduledStatusesComponent implements OnInit, OnDestroy {
|
|
|
|
private statusSub: Subscription;
|
|
|
|
scheduledStatuses: ScheduledStatusNotification[] = [];
|
2019-08-25 07:43:47 +02:00
|
|
|
|
2019-08-25 08:37:54 +02:00
|
|
|
constructor(
|
|
|
|
private readonly scheduledStatusService: ScheduledStatusService) {
|
|
|
|
}
|
2019-08-25 07:43:47 +02:00
|
|
|
|
2019-08-25 08:37:54 +02:00
|
|
|
ngOnInit() {
|
|
|
|
this.statusSub = this.scheduledStatusService.scheduledStatuses.subscribe((value: ScheduledStatusNotification[]) => {
|
|
|
|
console.warn(value);
|
|
|
|
this.scheduledStatuses = value;
|
|
|
|
});
|
|
|
|
}
|
2019-08-25 07:43:47 +02:00
|
|
|
|
2019-08-25 08:37:54 +02:00
|
|
|
ngOnDestroy(): void {
|
|
|
|
if (this.statusSub) this.statusSub.unsubscribe();
|
|
|
|
}
|
2019-08-25 07:43:47 +02:00
|
|
|
}
|