Moving to strict.
Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user