|
|
|
@ -42,6 +42,8 @@ export class HttpErrorWrapperComponent implements AfterViewInit, OnDestroy, OnIn |
|
|
|
|
|
|
|
backgroundColor: string; |
|
|
|
|
|
|
|
isHomeShow = true; |
|
|
|
|
|
|
|
@ViewChild('container', { static: false }) |
|
|
|
containerRef: ElementRef<HTMLDivElement>; |
|
|
|
|
|
|
|
@ -51,16 +53,21 @@ export class HttpErrorWrapperComponent implements AfterViewInit, OnDestroy, OnIn |
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
this.backgroundColor = |
|
|
|
snq(() => window.getComputedStyle(document.body).getPropertyValue('background-color')) || '#fff'; |
|
|
|
snq(() => window.getComputedStyle(document.body).getPropertyValue('background-color')) || |
|
|
|
'#fff'; |
|
|
|
} |
|
|
|
|
|
|
|
ngAfterViewInit() { |
|
|
|
if (this.customComponent) { |
|
|
|
const customComponentRef = this.cfRes.resolveComponentFactory(this.customComponent).create(this.injector); |
|
|
|
const customComponentRef = this.cfRes |
|
|
|
.resolveComponentFactory(this.customComponent) |
|
|
|
.create(this.injector); |
|
|
|
customComponentRef.instance.errorStatus = this.status; |
|
|
|
customComponentRef.instance.destroy$ = this.destroy$; |
|
|
|
this.appRef.attachView(customComponentRef.hostView); |
|
|
|
this.containerRef.nativeElement.appendChild((customComponentRef.hostView as EmbeddedViewRef<any>).rootNodes[0]); |
|
|
|
this.containerRef.nativeElement.appendChild( |
|
|
|
(customComponentRef.hostView as EmbeddedViewRef<any>).rootNodes[0], |
|
|
|
); |
|
|
|
customComponentRef.changeDetectorRef.detectChanges(); |
|
|
|
} |
|
|
|
|
|
|
|
|