Merge pull request #17187 from abpframework/dynamic-layout-fix

Dynamic layout musst solve layout oninit.
pull/17189/head
Masum ULU 2 years ago committed by GitHub
commit a4f904228e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,4 @@
import { Component, Injector, isDevMode, Optional, SkipSelf, Type } from '@angular/core';
import { Component, Injector, isDevMode, OnInit, Optional, SkipSelf, Type } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { eLayoutType } from '../enums/common';
import { ABP } from '../models';
@ -16,7 +16,7 @@ import { TreeNode } from '../utils/tree-utils';
template: ` <ng-container *ngIf="isLayoutVisible" [ngComponentOutlet]="layout"></ng-container> `,
providers: [SubscriptionService],
})
export class DynamicLayoutComponent {
export class DynamicLayoutComponent implements OnInit {
layout?: Type<any>;
layoutKey?: eLayoutType;
@ -53,6 +53,13 @@ export class DynamicLayoutComponent {
this.listenToLanguageChange();
}
ngOnInit(): void {
if(this.layout){
return;
}
this.getLayout()
}
private checkLayoutOnNavigationEnd() {
const navigationEnd$ = this.routerEvents.getNavigationEvents('End');
this.subscription.addOne(navigationEnd$, () => this.getLayout());

Loading…
Cancel
Save