Skip to content

Commit ac8d7f1

Browse files
Merge pull request #23856 from abpframework/fix/23795
Angular - Template layout breaks when APP_ROUTE_PROVIDER is removed from providers
2 parents 8e5704f + 5481bb4 commit ac8d7f1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
import { Component, inject, isDevMode, OnInit, Optional, SkipSelf, Type } from '@angular/core';
1+
import {
2+
Component,
3+
inject,
4+
input,
5+
isDevMode,
6+
OnInit,
7+
Optional,
8+
SkipSelf,
9+
Type,
10+
} from '@angular/core';
211
import { ActivatedRoute, Router } from '@angular/router';
312
import { eLayoutType } from '../enums/common';
413
import { ABP } from '../models';
@@ -29,6 +38,7 @@ export class DynamicLayoutComponent implements OnInit {
2938
layoutKey?: eLayoutType;
3039
readonly layouts = inject(DYNAMIC_LAYOUTS_TOKEN);
3140
isLayoutVisible = true;
41+
readonly defaultLayout = input<eLayoutType>(undefined);
3242

3343
protected readonly router = inject(Router);
3444
protected readonly route = inject(ActivatedRoute);
@@ -96,7 +106,7 @@ export class DynamicLayoutComponent implements OnInit {
96106
break;
97107
}
98108
}
99-
return expectedLayout;
109+
return expectedLayout ?? this.defaultLayout();
100110
}
101111

102112
showLayoutNotFoundError(layoutName: string) {

0 commit comments

Comments
 (0)