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 { PrinterListDataSource } from './printer-list-datasource';
|
||||
styleUrls: ['./printer-list.component.css'],
|
||||
})
|
||||
export class PrinterListComponent implements OnInit {
|
||||
dataSource: PrinterListDataSource;
|
||||
list: Printer[];
|
||||
list: Printer[] = [];
|
||||
dataSource: PrinterListDataSource = new PrinterListDataSource(this.list);
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'address', 'cutCode'];
|
||||
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { list: Printer[] }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { list: Printer[] };
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new PrinterListDataSource(this.list);
|
||||
|
||||
Reference in New Issue
Block a user