Moving to strict.
Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
@@ -42,11 +42,16 @@ export class RawMaterialCostComponent implements OnInit {
|
||||
private fb: FormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
) {
|
||||
this.createForm();
|
||||
this.form = this.fb.group({
|
||||
startDate: '',
|
||||
finishDate: '',
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { info: RawMaterialCost }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { info: RawMaterialCost };
|
||||
|
||||
this.info = data.info;
|
||||
this.displayedColumns = this.info.id ? this.columnsId : this.columnsNoId;
|
||||
this.form.setValue({
|
||||
@@ -67,13 +72,6 @@ export class RawMaterialCostComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
startDate: '',
|
||||
finishDate: '',
|
||||
});
|
||||
}
|
||||
|
||||
prepareSubmit(): RawMaterialCost {
|
||||
const formModel = this.form.value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user