Browse Source

Merge pull request #17189 from abpframework/auto-merge/rel-7-2/2085

Merge branch rel-7.3 with rel-7.2
pull/17192/head
Mahmut Gundogdu 3 years ago
committed by GitHub
parent
commit
60545e4535
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts

11
npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts

@ -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