From a826f0bdd92d4e30905d2158ec94d7d9d47d63c9 Mon Sep 17 00:00:00 2001 From: sumeyyeKurtulus Date: Mon, 25 Mar 2024 16:43:40 +0300 Subject: [PATCH] update: modifier updates --- .../dev-app/src/app/home/home.component.ts | 2 +- .../components/dynamic-layout.component.ts | 23 +++++++------------ .../application-layout.component.ts | 2 +- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts index b6a6082a6c..97f1d14b32 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts @@ -6,7 +6,7 @@ import { Component, inject } from '@angular/core'; templateUrl: './home.component.html', }) export class HomeComponent { - private authService = inject(AuthService); + protected readonly authService = inject(AuthService); loading = false; get hasLoggedIn(): boolean { 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 6d1bc58ba2..9d5df4d204 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 @@ -17,19 +17,19 @@ import { DYNAMIC_LAYOUTS_TOKEN } from '../tokens/dynamic-layout.token'; template: ` `, providers: [SubscriptionService], }) -export class DynamicLayoutComponent implements OnInit { +export class DynamicLayoutComponent { layout?: Type; layoutKey?: eLayoutType; readonly layouts = inject(DYNAMIC_LAYOUTS_TOKEN); isLayoutVisible = true; - private readonly router = inject(Router); - private readonly route = inject(ActivatedRoute); - private readonly routes = inject(RoutesService); - private localizationService = inject(LocalizationService); - private replaceableComponents = inject(ReplaceableComponentsService); - private subscription = inject(SubscriptionService); - private routerEvents = inject(RouterEvents); + protected readonly router = inject(Router); + protected readonly route = inject(ActivatedRoute); + protected readonly routes = inject(RoutesService); + protected readonly localizationService = inject(LocalizationService); + protected readonly replaceableComponents = inject(ReplaceableComponentsService); + protected readonly subscription = inject(SubscriptionService); + protected readonly routerEvents = inject(RouterEvents); constructor(@Optional() @SkipSelf() dynamicLayoutComponent: DynamicLayoutComponent) { if (dynamicLayoutComponent) { @@ -40,13 +40,6 @@ export class DynamicLayoutComponent implements OnInit { this.listenToLanguageChange(); } - ngOnInit(): void { - if (this.layout) { - return; - } - // this.getLayout(); - } - private checkLayoutOnNavigationEnd() { const navigationEnd$ = this.routerEvents.getNavigationEvents('End'); this.subscription.addOne(navigationEnd$, () => this.getLayout()); diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts index ba1e2cfa9c..a8084a3513 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts @@ -10,7 +10,7 @@ import { LayoutService } from '../../services/layout.service'; providers: [LayoutService, SubscriptionService], }) export class ApplicationLayoutComponent implements AfterViewInit { - public service = inject(LayoutService); + public readonly service = inject(LayoutService); // required for dynamic component static type = eLayoutType.application;