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,12 +42,17 @@ export class IncentiveComponent implements OnInit {
public auth: AuthService,
private ser: VoucherService,
) {
this.createForm();
this.form = this.fb.group({
date: '',
incentives: this.fb.array([]),
});
this.listenToDateChange();
}
ngOnInit() {
this.route.data.subscribe((data: { voucher: Voucher }) => {
this.route.data.subscribe((value) => {
const data = value as { voucher: Voucher };
this.loadVoucher(data.voucher);
});
}
@@ -69,13 +74,6 @@ export class IncentiveComponent implements OnInit {
this.incentiveObservable.next(this.voucher.incentives);
}
createForm() {
this.form = this.fb.group({
date: '',
incentives: this.fb.array([]),
});
}
listenToDateChange(): void {
this.form
.get('date')