Roles
This commit is contained in:
27
bookie/src/app/roles/role-list/role-list.component.ts
Normal file
27
bookie/src/app/roles/role-list/role-list.component.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { RoleListDataSource } from './role-list-datasource';
|
||||
import { Role } from '../role';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-role-list',
|
||||
templateUrl: './role-list.component.html',
|
||||
styleUrls: ['./role-list.component.css']
|
||||
})
|
||||
export class RoleListComponent implements OnInit {
|
||||
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.list);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user