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

View File

@ -23,17 +23,15 @@ export class BalanceSheetComponent implements OnInit {
displayedColumns = ['group', 'name', 'subAmount', 'total'];
constructor(private route: ActivatedRoute, private router: Router, private fb: FormBuilder) {
this.createForm();
}
createForm() {
this.form = this.fb.group({
date: '',
});
}
ngOnInit() {
this.route.data.subscribe((data: { info: BalanceSheet }) => {
this.route.data.subscribe((value) => {
const data = value as { info: BalanceSheet };
this.info = data.info;
this.form.setValue({
date: moment(this.info.date, 'DD-MMM-YYYY').toDate(),