fixed um console errors

master
FlayInAHook 4 years ago
parent c050447e01
commit 679bbe94d5

@ -65,7 +65,8 @@
[length]="dataSource.filteredData.length" [length]="dataSource.filteredData.length"
[pageIndex]="0" [pageIndex]="0"
[pageSize]="10" [pageSize]="10"
[pageSizeOptions]="[5, 10, 25, 100]"> [pageSizeOptions]="[5, 10, 25, 100]"
*ngIf="isLoaded">
</mat-paginator> </mat-paginator>
</div> </div>

@ -39,6 +39,7 @@ export class AdminDataPageComponent implements OnInit {
index: number; index: number;
id: number; id: number;
roles; roles;
isLoaded : boolean = false;
constructor(public httpClient: HttpClient, constructor(public httpClient: HttpClient,
public dialog: MatDialog, public dialog: MatDialog,
@ -142,6 +143,8 @@ export class AdminDataPageComponent implements OnInit {
user.email_old = user.email; user.email_old = user.email;
} }
this.dataSource = new MatTableDataSource(data); this.dataSource = new MatTableDataSource(data);
this.isLoaded = true;
this.afterLoad();
}); });
fromEvent(this.filter.nativeElement, 'keyup') fromEvent(this.filter.nativeElement, 'keyup')
// .debounceTime(150) // .debounceTime(150)
@ -155,6 +158,10 @@ export class AdminDataPageComponent implements OnInit {
} }
ngAfterViewInit() { ngAfterViewInit() {
}
afterLoad(){
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort; this.dataSource.sort = this.sort;
} }

Loading…
Cancel
Save