Updated to angular 11
Now compiling with strict mode in typescript Need to error checking now
This commit is contained in:
@ -17,10 +17,10 @@ import { TableListDataSource } from './table-list-datasource';
|
||||
styleUrls: ['./table-list.component.css'],
|
||||
})
|
||||
export class TableListComponent implements OnInit {
|
||||
@ViewChild('table', { static: true }) table: MatTable<MenuCategory>;
|
||||
dataSource: TableListDataSource;
|
||||
list: Table[];
|
||||
data: BehaviorSubject<Table[]>;
|
||||
@ViewChild('table', { static: true }) table?: MatTable<MenuCategory>;
|
||||
data: BehaviorSubject<Table[]> = new BehaviorSubject<Table[]>([]);
|
||||
dataSource: TableListDataSource = new TableListDataSource(this.data);
|
||||
list: Table[] = [];
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'seats', 'section', 'isActive'];
|
||||
|
||||
@ -30,14 +30,14 @@ export class TableListComponent implements OnInit {
|
||||
private toaster: ToasterService,
|
||||
private ser: TableService,
|
||||
) {
|
||||
this.data = new BehaviorSubject([]);
|
||||
this.data.subscribe((data: Table[]) => {
|
||||
this.list = data;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { list: Table[] }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { list: Table[] };
|
||||
this.data.next(data.list);
|
||||
});
|
||||
this.dataSource = new TableListDataSource(this.data);
|
||||
|
||||
Reference in New Issue
Block a user