From 3c215f920a1b61959bf78db0fceb978cbe6ad601 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Sun, 17 May 2026 16:03:00 +0700 Subject: [PATCH] feat(client): implement view child signal --- .../components/admin-platform/admin-platform.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/client/src/app/components/admin-platform/admin-platform.component.ts b/apps/client/src/app/components/admin-platform/admin-platform.component.ts index 48e4eb31e..fb6363a43 100644 --- a/apps/client/src/app/components/admin-platform/admin-platform.component.ts +++ b/apps/client/src/app/components/admin-platform/admin-platform.component.ts @@ -15,7 +15,7 @@ import { inject, Input, OnInit, - ViewChild + viewChild } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { MatButtonModule } from '@angular/material/button'; @@ -57,13 +57,13 @@ import { CreateOrUpdatePlatformDialogParams } from './create-or-update-platform- export class GfAdminPlatformComponent implements OnInit { @Input() locale = getLocale(); - @ViewChild(MatSort) sort: MatSort; - public dataSource = new MatTableDataSource(); public deviceType: string; public displayedColumns = ['name', 'url', 'accounts', 'actions']; public platforms: Platform[]; + private readonly sort = viewChild.required(MatSort); + private readonly adminService = inject(AdminService); private readonly changeDetectorRef = inject(ChangeDetectorRef); private readonly dataService = inject(DataService); @@ -145,7 +145,7 @@ export class GfAdminPlatformComponent implements OnInit { this.platforms = platforms; this.dataSource = new MatTableDataSource(platforms); - this.dataSource.sort = this.sort; + this.dataSource.sort = this.sort(); this.dataSource.sortingDataAccessor = get; this.dataService.updateInfo();