Moving to strict.
Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
1 parent
30b1a3ef7d
commit
39e3cc51bb
52 files changed
+348
-448
No files matched your search
@@ -58,12 +58,23 @@ export class JournalComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
private accountSer: AccountService,
|
||||
) {
|
||||
this.account = null;
|
||||
this.createForm();
|
||||
this.form = this.fb.group({
|
||||
date: '',
|
||||
addRow: this.fb.group({
|
||||
debit: '1',
|
||||
account: '',
|
||||
amount: '',
|
||||
}),
|
||||
narration: '',
|
||||
});
|
||||
this.accBal = null;
|
||||
this.setupAccountAutocomplete();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { voucher: Voucher }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { voucher: Voucher };
|
||||
|
||||
this.loadVoucher(data.voucher);
|
||||
});
|
||||
this.hotkeys.add(
|
||||
@@ -217,19 +228,6 @@ export class JournalComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
date: '',
|
||||
addRow: this.fb.group({
|
||||
debit: '1',
|
||||
account: '',
|
||||
amount: '',
|
||||
}),
|
||||
narration: '',
|
||||
});
|
||||
this.accBal = null;
|
||||
}
|
||||
|
||||
canSave() {
|
||||
if (!this.voucher.id) {
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user