mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
103176: Fix vcr not being defined yet in OnInit hook
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
import {
|
import {
|
||||||
|
AfterViewInit,
|
||||||
Component,
|
Component,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
ViewContainerRef,
|
ViewContainerRef,
|
||||||
ComponentRef,
|
ComponentRef,
|
||||||
SimpleChanges,
|
SimpleChanges,
|
||||||
OnInit,
|
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
ComponentFactoryResolver,
|
ComponentFactoryResolver,
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
@@ -21,7 +21,7 @@ import { GenericConstructor } from '../../core/shared/generic-constructor';
|
|||||||
styleUrls: ['./themed.component.scss'],
|
styleUrls: ['./themed.component.scss'],
|
||||||
templateUrl: './themed.component.html',
|
templateUrl: './themed.component.html',
|
||||||
})
|
})
|
||||||
export abstract class ThemedComponent<T> implements OnInit, OnDestroy, OnChanges {
|
export abstract class ThemedComponent<T> implements AfterViewInit, OnDestroy, OnChanges {
|
||||||
@ViewChild('vcr', { read: ViewContainerRef }) vcr: ViewContainerRef;
|
@ViewChild('vcr', { read: ViewContainerRef }) vcr: ViewContainerRef;
|
||||||
protected compRef: ComponentRef<T>;
|
protected compRef: ComponentRef<T>;
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ export abstract class ThemedComponent<T> implements OnInit, OnDestroy, OnChanges
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngAfterViewInit(): void {
|
||||||
this.destroyComponentInstance();
|
this.destroyComponentInstance();
|
||||||
this.themeSub = this.themeService.getThemeName$().subscribe(() => {
|
this.themeSub = this.themeService.getThemeName$().subscribe(() => {
|
||||||
this.renderComponentInstance();
|
this.renderComponentInstance();
|
||||||
|
Reference in New Issue
Block a user