Browse Source

refactoring

pull/23416/head
erdemcaygor 5 months ago
parent
commit
e2b4e0f8c6
  1. 4
      npm/ng-packs/packages/core/src/lib/services/dom-strategy.service.ts
  2. 2
      npm/ng-packs/packages/core/src/lib/services/ssr.service.ts
  3. 3
      npm/ng-packs/packages/theme-shared/src/lib/directives/ngx-datatable-default.directive.ts

4
npm/ng-packs/packages/core/src/lib/services/dom-strategy.service.ts

@ -1,10 +1,10 @@
import { Inject, Injectable } from '@angular/core';
import { inject, Inject, Injectable } from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { DomStrategy } from '../strategies';
@Injectable({ providedIn: 'root' })
export class DomStrategyService {
constructor(@Inject(DOCUMENT) private document: Document) {}
private document = inject(DOCUMENT);
afterElement(el: HTMLElement) {
return new DomStrategy(() => el, 'afterend');

2
npm/ng-packs/packages/core/src/lib/services/ssr.service.ts

@ -5,7 +5,7 @@ import { isPlatformBrowser, isPlatformServer } from '@angular/common';
providedIn: 'root',
})
export class SSRService {
constructor(@Inject(PLATFORM_ID) private platformId: unknown) {}
private platformId = Inject(PLATFORM_ID);
get isBrowser() {
return isPlatformBrowser(this.platformId);

3
npm/ng-packs/packages/theme-shared/src/lib/directives/ngx-datatable-default.directive.ts

@ -21,6 +21,7 @@ import { debounceTime } from 'rxjs/operators';
export class NgxDatatableDefaultDirective implements AfterViewInit, OnDestroy {
private table = inject(DatatableComponent);
private document = inject<MockDocument>(DOCUMENT);
private platformId = inject(PLATFORM_ID);
private subscription = new Subscription();
private resizeDiff = 0;
@ -32,7 +33,7 @@ export class NgxDatatableDefaultDirective implements AfterViewInit, OnDestroy {
return `ngx-datatable ${this.class}`;
}
constructor(@Inject(PLATFORM_ID) private platformId: object) {
constructor() {
this.table.columnMode = ColumnMode.force;
this.table.footerHeight = 50;
this.table.headerHeight = 50;

Loading…
Cancel
Save