mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merge branch 'fix-ngonchanges-not-working-for-themed-components_contribute-7.2' into fix-ngonchanges-not-working-for-themed-components_contribute-7.4
This commit is contained in:
@@ -60,7 +60,6 @@ export abstract class ThemedComponent<T> implements OnInit, OnDestroy, OnChanges
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.destroyComponentInstance();
|
||||
this.initComponentInstance();
|
||||
}
|
||||
|
||||
@@ -81,8 +80,6 @@ export abstract class ThemedComponent<T> implements OnInit, OnDestroy, OnChanges
|
||||
}
|
||||
|
||||
if (hasNoValue(this.lazyLoadObs)) {
|
||||
this.destroyComponentInstance();
|
||||
|
||||
this.lazyLoadObs = combineLatest([
|
||||
observableOf(changes),
|
||||
this.resolveThemedComponent(this.themeService.getThemeName()).pipe(
|
||||
@@ -104,6 +101,7 @@ export abstract class ThemedComponent<T> implements OnInit, OnDestroy, OnChanges
|
||||
}
|
||||
|
||||
this.lazyLoadSub = this.lazyLoadObs.subscribe(([simpleChanges, constructor]: [SimpleChanges, GenericConstructor<T>]) => {
|
||||
this.destroyComponentInstance();
|
||||
const factory = this.resolver.resolveComponentFactory(constructor);
|
||||
this.compRef = this.vcr.createComponent(factory);
|
||||
if (hasValue(simpleChanges)) {
|
||||
|
Reference in New Issue
Block a user