|
@ -2,6 +2,7 @@ import { Component, ElementRef, OnInit, ViewChild } from "@angular/core"; |
|
|
import { FormBuilder, FormGroup, Validators } from "@angular/forms"; |
|
|
import { FormBuilder, FormGroup, Validators } from "@angular/forms"; |
|
|
import { Router } from "@angular/router"; |
|
|
import { Router } from "@angular/router"; |
|
|
import { GENDER_LIST, SCHEDULE_APPOINTMENT } from "src/constants/constants"; |
|
|
import { GENDER_LIST, SCHEDULE_APPOINTMENT } from "src/constants/constants"; |
|
|
|
|
|
import { ScheduleAppointmentService } from "../schedule-appointment/schedule-appointment.service"; |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
selector: "app-add-dependants", |
|
|
selector: "app-add-dependants", |
|
@ -9,7 +10,7 @@ import { GENDER_LIST, SCHEDULE_APPOINTMENT } from "src/constants/constants"; |
|
|
styleUrls: ["./add-dependants.component.scss"], |
|
|
styleUrls: ["./add-dependants.component.scss"], |
|
|
}) |
|
|
}) |
|
|
export class AddDependantsComponent implements OnInit { |
|
|
export class AddDependantsComponent implements OnInit { |
|
|
generateLetterForm!: FormGroup; |
|
|
|
|
|
|
|
|
addDependantForm!: FormGroup; |
|
|
name = "Angular Html To Pdf "; |
|
|
name = "Angular Html To Pdf "; |
|
|
|
|
|
|
|
|
@ViewChild("pdfTable", { static: false }) pdfTable: ElementRef | undefined; |
|
|
@ViewChild("pdfTable", { static: false }) pdfTable: ElementRef | undefined; |
|
@ -20,14 +21,14 @@ export class AddDependantsComponent implements OnInit { |
|
|
isMaxCount: boolean = false; |
|
|
isMaxCount: boolean = false; |
|
|
genderList = GENDER_LIST; |
|
|
genderList = GENDER_LIST; |
|
|
|
|
|
|
|
|
constructor(private formBuilder: FormBuilder, private router:Router) { |
|
|
|
|
|
|
|
|
constructor(private formBuilder: FormBuilder, private router:Router, private scheduleAppointmentService:ScheduleAppointmentService) { |
|
|
this.createNewForm(); |
|
|
this.createNewForm(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ngOnInit(): void {} |
|
|
ngOnInit(): void {} |
|
|
|
|
|
|
|
|
createNewForm(): void { |
|
|
createNewForm(): void { |
|
|
this.generateLetterForm = this.formBuilder.group({ |
|
|
|
|
|
|
|
|
this.addDependantForm = this.formBuilder.group({ |
|
|
nameOfDependant: ["John"], |
|
|
nameOfDependant: ["John"], |
|
|
employeeRelation: ["Brother"], |
|
|
employeeRelation: ["Brother"], |
|
|
age: ["34"], |
|
|
age: ["34"], |
|
@ -49,6 +50,9 @@ export class AddDependantsComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
navigateToPrevious(){ |
|
|
navigateToPrevious(){ |
|
|
|
|
|
console.log(JSON.stringify(this.addDependantForm.value)); |
|
|
|
|
|
let responseObject = this.addDependantForm.value; |
|
|
|
|
|
this.scheduleAppointmentService.saveAdditionalDependentDetails(responseObject); |
|
|
this.router.navigate([SCHEDULE_APPOINTMENT]); |
|
|
this.router.navigate([SCHEDULE_APPOINTMENT]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |