From 2eb9e6b946fb74f931515dbcca7bfe6b79654f9e Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Wed, 25 Dec 2019 18:28:40 +0300 Subject: [PATCH] refactor(core): remove unnecessary if blocks #2404 --- .../replaceable-route-container.component.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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))