diff --git a/npm/ng-packs/packages/core/src/lib/components/replaceable-route-container.component.ts b/npm/ng-packs/packages/core/src/lib/components/replaceable-route-container.component.ts index af4805177d..80a56cfb04 100644 --- a/npm/ng-packs/packages/core/src/lib/components/replaceable-route-container.component.ts +++ b/npm/ng-packs/packages/core/src/lib/components/replaceable-route-container.component.ts @@ -23,13 +23,9 @@ export class ReplaceableRouteContainerComponent implements OnInit, OnDestroy { constructor(private route: ActivatedRoute, private store: Store) {} ngOnInit() { - if (!this.defaultComponent) { - this.defaultComponent = this.route.snapshot.data.component.default; - } - - if (!this.componentKey) { - this.componentKey = (this.route.snapshot.data.component as ABP.ComponentData).key; - } + this.defaultComponent = this.route.snapshot.data.replaceableComponent.defaultComponent; + this.componentKey = (this.route.snapshot.data + .replaceableComponent as ReplaceableComponents.RouteData).key; this.store .select(ReplaceableComponentsState.getComponent(this.componentKey))