Moving to strict.
Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
@ -38,10 +38,6 @@ export class AttendanceComponent implements OnInit {
|
||||
private auth: AuthService,
|
||||
private ser: AttendanceService,
|
||||
) {
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
date: '',
|
||||
attendances: this.fb.array([]),
|
||||
@ -49,7 +45,9 @@ export class AttendanceComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { info: Attendance; attendanceTypes: AttendanceType[] }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { info: Attendance; attendanceTypes: AttendanceType[] };
|
||||
|
||||
this.info = data.info;
|
||||
this.attendanceTypes = data.attendanceTypes;
|
||||
this.form.get('date').setValue(moment(this.info.date, 'DD-MMM-YYYY').toDate());
|
||||
|
||||
Reference in New Issue
Block a user