diff --git a/src/app/components/admin-data-page/admin-data-page.component.html b/src/app/components/admin-data-page/admin-data-page.component.html index 23d9dc0..d8166e9 100644 --- a/src/app/components/admin-data-page/admin-data-page.component.html +++ b/src/app/components/admin-data-page/admin-data-page.component.html @@ -65,7 +65,8 @@ [length]="dataSource.filteredData.length" [pageIndex]="0" [pageSize]="10" - [pageSizeOptions]="[5, 10, 25, 100]"> + [pageSizeOptions]="[5, 10, 25, 100]" + *ngIf="isLoaded"> diff --git a/src/app/components/admin-data-page/admin-data-page.component.ts b/src/app/components/admin-data-page/admin-data-page.component.ts index e3fe8d9..49f650c 100644 --- a/src/app/components/admin-data-page/admin-data-page.component.ts +++ b/src/app/components/admin-data-page/admin-data-page.component.ts @@ -39,6 +39,7 @@ export class AdminDataPageComponent implements OnInit { index: number; id: number; roles; + isLoaded : boolean = false; constructor(public httpClient: HttpClient, public dialog: MatDialog, @@ -142,6 +143,8 @@ export class AdminDataPageComponent implements OnInit { user.email_old = user.email; } this.dataSource = new MatTableDataSource(data); + this.isLoaded = true; + this.afterLoad(); }); fromEvent(this.filter.nativeElement, 'keyup') // .debounceTime(150) @@ -155,6 +158,10 @@ export class AdminDataPageComponent implements OnInit { } ngAfterViewInit() { + + } + + afterLoad(){ this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; }