mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 15:03:07 +00:00
[DURACOM-191] fix dynamicComponentLoader
This commit is contained in:
@@ -1 +1 @@
|
||||
<ng-template dsDynamicComponentLoader></ng-template>
|
||||
<ng-template #DynamicComponentLoader dsDynamicComponentLoader></ng-template>
|
||||
|
@@ -19,13 +19,17 @@ import { DynamicComponentLoaderDirective } from './dynamic-component-loader.dire
|
||||
@Component({
|
||||
selector: 'ds-abstract-component-loader',
|
||||
templateUrl: './abstract-component-loader.component.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
DynamicComponentLoaderDirective,
|
||||
]
|
||||
})
|
||||
export abstract class AbstractComponentLoaderComponent<T> implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
/**
|
||||
* Directive to determine where the dynamic child component is located
|
||||
*/
|
||||
@ViewChild(DynamicComponentLoaderDirective, { static: true }) componentDirective: DynamicComponentLoaderDirective;
|
||||
@ViewChild('DynamicComponentLoader', { static: true, read: ViewContainerRef }) componentViewContainerRef: ViewContainerRef;
|
||||
|
||||
/**
|
||||
* The reference to the dynamic component
|
||||
@@ -94,7 +98,7 @@ export abstract class AbstractComponentLoaderComponent<T> implements OnInit, OnC
|
||||
public instantiateComponent(): void {
|
||||
const component: GenericConstructor<T> = this.getComponent();
|
||||
|
||||
const viewContainerRef: ViewContainerRef = this.componentDirective.viewContainerRef;
|
||||
const viewContainerRef: ViewContainerRef = this.componentViewContainerRef;
|
||||
viewContainerRef.clear();
|
||||
|
||||
this.compRef = viewContainerRef.createComponent(
|
||||
|
@@ -11,7 +11,7 @@ import { RouterLink } from '@angular/router';
|
||||
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { ThemedLangSwitchComponent } from 'src/app/shared/lang-switch/themed-lang-switch.component';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import { AsyncPipe, NgIf } from '@angular/common';
|
||||
|
||||
/**
|
||||
* Represents the header with the logo and simple navigation
|
||||
@@ -21,7 +21,7 @@ import { AsyncPipe } from '@angular/common';
|
||||
styleUrls: ['header.component.scss'],
|
||||
templateUrl: 'header.component.html',
|
||||
standalone: true,
|
||||
imports: [NgbDropdownModule, ThemedLangSwitchComponent, RouterLink, ThemedSearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, ThemedNavbarComponent, TranslateModule, AsyncPipe]
|
||||
imports: [NgbDropdownModule, ThemedLangSwitchComponent, RouterLink, ThemedSearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, ThemedNavbarComponent, TranslateModule, AsyncPipe, NgIf]
|
||||
})
|
||||
export class HeaderComponent extends BaseComponent implements OnInit {
|
||||
public isNavBarCollapsed$: Observable<boolean>;
|
||||
|
Reference in New Issue
Block a user