Strict done!!
This commit is contained in:
@ -51,8 +51,6 @@ export class RoleListDatasource extends DataSource<Role> {
|
||||
switch (sort.active) {
|
||||
case 'name':
|
||||
return compare(a.name, b.name, isAsc);
|
||||
case 'id':
|
||||
return compare(+a.id, +b.id, isAsc);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -15,8 +15,8 @@ import { RoleListDatasource } from './role-list-datasource';
|
||||
export class RoleListComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
dataSource: RoleListDatasource;
|
||||
list: Role[];
|
||||
list: Role[] = [];
|
||||
dataSource: RoleListDatasource = new RoleListDatasource(this.list);
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'permissions'];
|
||||
|
||||
@ -28,6 +28,6 @@ export class RoleListComponent implements OnInit {
|
||||
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new RoleListDatasource(this.paginator, this.sort, this.list);
|
||||
this.dataSource = new RoleListDatasource(this.list, this.paginator, this.sort);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user