From 4cbaff3ee7a66a7102b347b937232eb42edde3ad Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Thu, 25 Aug 2022 17:34:07 +0300 Subject: [PATCH] Add layout notfound error in dynamic layout. --- .../src/lib/components/dynamic-layout.component.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts b/npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts index 61846ad126..a411fa0ba9 100644 --- a/npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts +++ b/npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts @@ -82,7 +82,19 @@ export class DynamicLayoutComponent { const key = this.layouts.get(expectedLayout); this.layout = this.getComponent(key)?.component; this.layoutKey = expectedLayout; + if(!this.layout){ + this.showLayoutNotFoundError(expectedLayout); + } + } + + showLayoutNotFoundError(layoutName: string) { + let message = `Layout ${layoutName} not found.`; + if(layoutName === 'account'){ + message = 'Account layout not found. Please check your configuration. If you are using LeptonX, please make sure you have added "AccountLayoutModule.forRoot()" to your app.module configuration.'; + } + console.error(message); } + private listenToLanguageChange() { this.subscription.addOne(this.localizationService.languageChange$, () => {