mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +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 {
|
ngOnInit(): void {
|
||||||
this.destroyComponentInstance();
|
|
||||||
this.initComponentInstance();
|
this.initComponentInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,8 +80,6 @@ export abstract class ThemedComponent<T> implements OnInit, OnDestroy, OnChanges
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hasNoValue(this.lazyLoadObs)) {
|
if (hasNoValue(this.lazyLoadObs)) {
|
||||||
this.destroyComponentInstance();
|
|
||||||
|
|
||||||
this.lazyLoadObs = combineLatest([
|
this.lazyLoadObs = combineLatest([
|
||||||
observableOf(changes),
|
observableOf(changes),
|
||||||
this.resolveThemedComponent(this.themeService.getThemeName()).pipe(
|
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.lazyLoadSub = this.lazyLoadObs.subscribe(([simpleChanges, constructor]: [SimpleChanges, GenericConstructor<T>]) => {
|
||||||
|
this.destroyComponentInstance();
|
||||||
const factory = this.resolver.resolveComponentFactory(constructor);
|
const factory = this.resolver.resolveComponentFactory(constructor);
|
||||||
this.compRef = this.vcr.createComponent(factory);
|
this.compRef = this.vcr.createComponent(factory);
|
||||||
if (hasValue(simpleChanges)) {
|
if (hasValue(simpleChanges)) {
|
||||||
|
Reference in New Issue
Block a user