Files
brewman/overlord/src/app/role/role-list/role-list.component.ts
tanshu 5ea09df272 Prettied, Linted and updated angular.json according to the latest schematic of Angular CLI.
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
2020-10-10 08:45:05 +05:30

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);
}
}