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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
2 deletions
-
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()); |
|
|
|
|