import { Component , OnDestroy } from '@angular/core' ; import { Store } from '@ngrx/store' ; import { Subscription } from 'rxjs' ; import { AppState , getMissingDeviceState } from '../../store' ; import { MissingDeviceState } from '../../models/missing-device-state' ; @ Component ( { selector : 'missing-device' , templateUrl : './missing-device.component.html' , host : { 'class' : 'container-fluid vertical-center-component' } } ) export class MissingDeviceComponent implements OnDestroy { state : MissingDeviceState ; private stateSubscription : Subscription ; constructor ( private store ) { this . stateSubscription = this . store . select ( getMissingDeviceState ) . subscribe ( state => this . state = state ) ; } ngOnDestroy ( ) { this . stateSubscription . unsubscribe ( ) ; } }