mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-07-01 12:06:23 +00:00
Move deploy blur logic to parent component
This commit is contained in:
@ -1,10 +1,28 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||
import {DeploymentNotificationService} from '../services/deployment-notification.service';
|
||||
import {Subscription} from 'rxjs/Subscription';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard',
|
||||
templateUrl: './dashboard.component.html',
|
||||
styleUrls: ['./dashboard.component.scss']
|
||||
})
|
||||
export class DashboardComponent {
|
||||
constructor() {}
|
||||
export class DashboardComponent implements OnInit, OnDestroy {
|
||||
|
||||
deploying = false;
|
||||
deploymentNotificationSubscription: Subscription;
|
||||
|
||||
constructor(private deploymentNotificationService: DeploymentNotificationService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.deploymentNotificationSubscription = this.deploymentNotificationService.deploying.subscribe(
|
||||
(deploying) => this.deploying = deploying
|
||||
);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
if (this.deploymentNotificationSubscription) {
|
||||
this.deploymentNotificationSubscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user