Browse Source

update: dynamic layout for url matching

pull/25174/head
sumeyye 6 months ago
parent
commit
bd86923b0a
  1. 6
      npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts

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

@ -14,7 +14,8 @@ import { ReplaceableComponentsService } from '../services/replaceable-components
import { RouterEvents } from '../services/router-events.service';
import { RoutesService } from '../services/routes.service';
import { SubscriptionService } from '../services/subscription.service';
import { findRoute, getRoutePath } from '../utils/route-utils';
import { RouteBasedCultureUrlService } from '../services/route-based-culture-url.service';
import { findRoute } from '../utils/route-utils';
import { TreeNode } from '../utils/tree-utils';
import { DYNAMIC_LAYOUTS_TOKEN } from '../tokens/dynamic-layout.token';
import { EnvironmentService } from '../services';
@ -46,6 +47,7 @@ export class DynamicLayoutComponent {
protected readonly subscription = inject(SubscriptionService);
protected readonly routerEvents = inject(RouterEvents);
protected readonly environment = inject(EnvironmentService);
protected readonly routeCultureUrl = inject(RouteBasedCultureUrlService);
constructor() {
const dynamicLayoutComponent = inject(DynamicLayoutComponent, { optional: true, skipSelf: true });
@ -85,7 +87,7 @@ export class DynamicLayoutComponent {
const routeData = this.route.snapshot.data || {};
let expectedLayout = routeData['layout'] as eLayoutType;
let node = findRoute(this.routes, getRoutePath(this.router));
let node = findRoute(this.routes, this.routeCultureUrl.getRoutePathForMatching(this.router));
node = { parent: node } as TreeNode<ABP.Route>;
while (node.parent) {

Loading…
Cancel
Save