I'm working in forms and I have two components: my child component contains this formGroup Object :
employeeForm : FormGroup;
this.employeeForm = new FormGroup({
firstName:new FormControl(),
lastNAme:new FormControl(),
email:new FormControl()
});
the child Component conatins just a small part of the form and the parent componant, contains the global form with submit button..
my issue is: I want in the Parent Component when I click on submit button I get the form group from my child component and push it to my global form in my parent component.
I add output in my child component :
@Output() onFormGroupChange: EventEmitter<FormGroup> = new EventEmitter<FormGroup>();
but I don't know how to let the submit button in parent Comp take the FormGroup object from my child component and proceed to push data...
do you have any idea on how to achieve this?
Thanks in advance.
Best Regards.