Moving to strict.

Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
2020-11-23 09:18:02 +05:30
parent 30b1a3ef7d
commit 39e3cc51bb
52 changed files with 348 additions and 448 deletions
@@ -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;