diff --git a/libs/ui/src/lib/benchmark/benchmark.component.ts b/libs/ui/src/lib/benchmark/benchmark.component.ts index ec213f3b0..98831a815 100644 --- a/libs/ui/src/lib/benchmark/benchmark.component.ts +++ b/libs/ui/src/lib/benchmark/benchmark.component.ts @@ -21,8 +21,8 @@ import { Input, OnChanges, Output, - ViewChild, - inject + inject, + viewChild } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { MatButtonModule } from '@angular/material/button'; @@ -72,7 +72,7 @@ export class GfBenchmarkComponent implements OnChanges { @Output() itemDeleted = new EventEmitter(); - @ViewChild(MatSort) protected sort: MatSort; + protected readonly sort = viewChild(MatSort); protected readonly dataSource = new MatTableDataSource([]); protected displayedColumns = [ @@ -117,7 +117,7 @@ export class GfBenchmarkComponent implements OnChanges { this.dataSource.data = this.benchmarks; this.dataSource.sortingDataAccessor = getLowercase; - this.dataSource.sort = this.sort; + this.dataSource.sort = this.sort(); this.isLoading = false; }