Browse Source

feat(client): implement view child signal

pull/6892/head
KenTandrian 1 week ago
parent
commit
3c215f920a
  1. 8
      apps/client/src/app/components/admin-platform/admin-platform.component.ts

8
apps/client/src/app/components/admin-platform/admin-platform.component.ts

@ -15,7 +15,7 @@ import {
inject, inject,
Input, Input,
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 { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
@ -57,13 +57,13 @@ import { CreateOrUpdatePlatformDialogParams } from './create-or-update-platform-
export class GfAdminPlatformComponent implements OnInit { export class GfAdminPlatformComponent implements OnInit {
@Input() locale = getLocale(); @Input() locale = getLocale();
@ViewChild(MatSort) sort: MatSort;
public dataSource = new MatTableDataSource<Platform>(); public dataSource = new MatTableDataSource<Platform>();
public deviceType: string; public deviceType: string;
public displayedColumns = ['name', 'url', 'accounts', 'actions']; public displayedColumns = ['name', 'url', 'accounts', 'actions'];
public platforms: Platform[]; public platforms: Platform[];
private readonly sort = viewChild.required(MatSort);
private readonly adminService = inject(AdminService); private readonly adminService = inject(AdminService);
private readonly changeDetectorRef = inject(ChangeDetectorRef); private readonly changeDetectorRef = inject(ChangeDetectorRef);
private readonly dataService = inject(DataService); private readonly dataService = inject(DataService);
@ -145,7 +145,7 @@ export class GfAdminPlatformComponent implements OnInit {
this.platforms = platforms; this.platforms = platforms;
this.dataSource = new MatTableDataSource(platforms); this.dataSource = new MatTableDataSource(platforms);
this.dataSource.sort = this.sort; this.dataSource.sort = this.sort();
this.dataSource.sortingDataAccessor = get; this.dataSource.sortingDataAccessor = get;
this.dataService.updateInfo(); this.dataService.updateInfo();

Loading…
Cancel
Save