Moving to strict.
Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
@ -19,10 +19,6 @@ export class CashFlowComponent implements OnInit {
|
||||
displayedColumns = ['name', 'amount'];
|
||||
|
||||
constructor(private route: ActivatedRoute, private router: Router, private fb: FormBuilder) {
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
startDate: '',
|
||||
finishDate: '',
|
||||
@ -30,7 +26,9 @@ export class CashFlowComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { info: CashFlow }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { info: CashFlow };
|
||||
|
||||
this.info = data.info;
|
||||
this.form.setValue({
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
|
||||
Reference in New Issue
Block a user