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