Updated to angular 11
Now compiling with strict mode in typescript Need to error checking now
This commit is contained in:
@ -11,15 +11,16 @@ import { RoleListDataSource } from './role-list-datasource';
|
||||
styleUrls: ['./role-list.component.css'],
|
||||
})
|
||||
export class RoleListComponent implements OnInit {
|
||||
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'];
|
||||
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { list: Role[] }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { list: Role[] };
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new RoleListDataSource(this.list);
|
||||
|
||||
Reference in New Issue
Block a user