Moving to strict.
Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
@ -38,14 +38,10 @@ export class EmployeeListComponent implements OnInit, AfterViewInit {
|
||||
];
|
||||
|
||||
constructor(private route: ActivatedRoute, private fb: FormBuilder, private toCsv: ToCsvService) {
|
||||
this.createForm();
|
||||
this.filter = this.listenToFilterChange();
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
filter: '',
|
||||
});
|
||||
this.filter = this.listenToFilterChange();
|
||||
}
|
||||
|
||||
listenToFilterChange() {
|
||||
@ -55,7 +51,9 @@ export class EmployeeListComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { list: Employee[] }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { list: Employee[] };
|
||||
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new EmployeeListDataSource(this.paginator, this.sort, this.filter, this.list);
|
||||
|
||||
Reference in New Issue
Block a user