Browse Source

feat(client): implement viewChild signal

pull/6739/head
KenTandrian 1 week ago
parent
commit
712048da0c
  1. 6
      apps/client/src/app/components/admin-jobs/admin-jobs.component.ts

6
apps/client/src/app/components/admin-jobs/admin-jobs.component.ts

@ -21,7 +21,7 @@ import {
Component, Component,
DestroyRef, DestroyRef,
OnInit, OnInit,
ViewChild viewChild
} from '@angular/core'; } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { import {
@ -75,7 +75,7 @@ import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
templateUrl: './admin-jobs.html' templateUrl: './admin-jobs.html'
}) })
export class GfAdminJobsComponent implements OnInit { export class GfAdminJobsComponent implements OnInit {
@ViewChild(MatSort) sort: MatSort; protected readonly sort = viewChild.required(MatSort);
protected readonly DATA_GATHERING_QUEUE_PRIORITY_LOW = protected readonly DATA_GATHERING_QUEUE_PRIORITY_LOW =
DATA_GATHERING_QUEUE_PRIORITY_LOW; DATA_GATHERING_QUEUE_PRIORITY_LOW;
@ -227,7 +227,7 @@ export class GfAdminJobsComponent implements OnInit {
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ jobs }) => { .subscribe(({ jobs }) => {
this.dataSource = new MatTableDataSource(jobs); this.dataSource = new MatTableDataSource(jobs);
this.dataSource.sort = this.sort; this.dataSource.sort = this.sort();
this.dataSource.sortingDataAccessor = get; this.dataSource.sortingDataAccessor = get;
this.isLoading = false; this.isLoading = false;

Loading…
Cancel
Save