Now all that is needed is to make it ready for strict compiling. Removed eslint-plugin-prettier as it is not recommended and causes errors for both eslint and prettier Bumped to v8.0.0
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import { Component, OnInit, ViewChild } from '@angular/core';
|
|
import { MatPaginator } from '@angular/material/paginator';
|
|
import { MatSort } from '@angular/material/sort';
|
|
import { ActivatedRoute } from '@angular/router';
|
|
|
|
import { Role } from '../role';
|
|
|
|
import { RoleListDatasource } from './role-list-datasource';
|
|
|
|
@Component({
|
|
selector: 'app-role-list',
|
|
templateUrl: './role-list.component.html',
|
|
styleUrls: ['./role-list.component.css'],
|
|
})
|
|
export class RoleListComponent implements OnInit {
|
|
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
|
@ViewChild(MatSort, { static: true }) sort: MatSort;
|
|
dataSource: RoleListDatasource;
|
|
list: Role[];
|
|
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
|
displayedColumns = ['name', 'permissions'];
|
|
|
|
constructor(private route: ActivatedRoute) {}
|
|
|
|
ngOnInit() {
|
|
this.route.data.subscribe((data: { list: Role[] }) => {
|
|
this.list = data.list;
|
|
});
|
|
this.dataSource = new RoleListDatasource(this.paginator, this.sort, this.list);
|
|
}
|
|
}
|