Browse Source

Remove unused imports and minor constructor cleanup

Eliminated unused imports from several components and directives to improve code clarity and reduce bundle size. Added an explicit constructor to DateParserFormatter for consistency. No functional changes were made.
pull/23262/head
Fahri Gedik 1 year ago
parent
commit
699f4ad31b
  1. 2
      npm/ng-packs/packages/components/extensible/src/lib/components/grid-actions/grid-actions.component.ts
  2. 2
      npm/ng-packs/packages/schematics/src/utils/service.ts
  3. 1
      npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts
  4. 1
      npm/ng-packs/packages/theme-shared/src/lib/directives/ellipsis.directive.ts
  5. 1
      npm/ng-packs/packages/theme-shared/src/lib/directives/loading.directive.ts
  6. 4
      npm/ng-packs/packages/theme-shared/src/lib/utils/date-parser-formatter.ts

2
npm/ng-packs/packages/components/extensible/src/lib/components/grid-actions/grid-actions.component.ts

@ -45,8 +45,6 @@ export class GridActionsComponent<R = any> extends AbstractActionsComponent<Enti
readonly trackByFn: TrackByFunction<EntityAction<R>> = (_, item) => item.text;
constructor() {
const injector = inject(Injector);
super();
}
}

2
npm/ng-packs/packages/schematics/src/utils/service.ts

@ -46,7 +46,7 @@ export function createControllerToServiceMapper({
[],
);
imports.push(new Import({ path: '@abp/ng.core', specifiers: ['RestService', 'Rest'] }));
imports.push(new Import({ path: '@angular/core', specifiers: ['Injectable'] }));
imports.push(new Import({ path: '@angular/core', specifiers: ['Injectable', 'inject'] }));
sortImports(imports);
const methods = actions.map(mapActionToMethod);
sortMethods(methods);

1
npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts

@ -1,5 +1,4 @@
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, inject } from '@angular/core';
import { Router } from '@angular/router';
import { CommonModule } from '@angular/common';
import { combineLatest, Subscription, timer } from 'rxjs';
import { HttpWaitService, RouterWaitService, SubscriptionService } from '@abp/ng.core';

1
npm/ng-packs/packages/theme-shared/src/lib/directives/ellipsis.directive.ts

@ -5,7 +5,6 @@ import {
ElementRef,
HostBinding,
Input,
NgModule,
inject
} from '@angular/core';

1
npm/ng-packs/packages/theme-shared/src/lib/directives/loading.directive.ts

@ -10,7 +10,6 @@ import {
OnDestroy,
OnInit,
Renderer2,
ViewContainerRef,
inject
} from '@angular/core';
import { Subscription, timer } from 'rxjs';

4
npm/ng-packs/packages/theme-shared/src/lib/utils/date-parser-formatter.ts

@ -16,6 +16,10 @@ export class DateParserFormatter extends NgbDateParserFormatter {
private configState = inject(ConfigStateService);
private locale = inject(LOCALE_ID);
constructor() {
super();
}
parse(value: string): NgbDateStruct | null {
if (value) {

Loading…
Cancel
Save