2022-01-20 09:03:45 +00:00
|
|
|
import { Component, OnInit, OnDestroy } from '@angular/core';
|
|
|
|
import { ConfigService } from '../../service/app.config.service';
|
|
|
|
import { AppConfig } from '../../api/appconfig';
|
|
|
|
import { Subscription } from 'rxjs';
|
2022-01-14 16:19:36 +00:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-error',
|
|
|
|
templateUrl: './error.component.html',
|
|
|
|
})
|
2022-01-20 09:03:45 +00:00
|
|
|
export class ErrorComponent implements OnInit, OnDestroy {
|
|
|
|
|
|
|
|
config: AppConfig;
|
|
|
|
subscription: Subscription;
|
|
|
|
|
|
|
|
constructor(public configService: ConfigService){ }
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
this.config = this.configService.config;
|
|
|
|
this.subscription = this.configService.configUpdate$.subscribe(config => {
|
|
|
|
this.config = config;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy(): void {
|
|
|
|
if(this.subscription){
|
|
|
|
this.subscription.unsubscribe();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|