From 5481bb442a5d8493f4898630f37160dfe1b7a88a Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Thu, 2 Oct 2025 15:10:42 +0300 Subject: [PATCH] default layout option added to dynamic-layout component --- .../src/lib/components/dynamic-layout.component.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 a5c22db189..a28832a054 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 @@ -1,4 +1,13 @@ -import { Component, inject, isDevMode, OnInit, Optional, SkipSelf, Type } from '@angular/core'; +import { + Component, + inject, + input, + isDevMode, + OnInit, + Optional, + SkipSelf, + Type, +} from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { eLayoutType } from '../enums/common'; import { ABP } from '../models'; @@ -29,6 +38,7 @@ export class DynamicLayoutComponent implements OnInit { layoutKey?: eLayoutType; readonly layouts = inject(DYNAMIC_LAYOUTS_TOKEN); isLayoutVisible = true; + readonly defaultLayout = input(undefined); protected readonly router = inject(Router); protected readonly route = inject(ActivatedRoute); @@ -96,7 +106,7 @@ export class DynamicLayoutComponent implements OnInit { break; } } - return expectedLayout; + return expectedLayout ?? this.defaultLayout(); } showLayoutNotFoundError(layoutName: string) {