Вы можете передать всю форму от родителя (accessoryComponent
) ребенку (mobileItemComponent
) с помощью ввода, например:
parent.ts
constructor(fb: FormBuilder) {
this.form = fb.group({
login: ['', Validators.required],
password: [null, Validators.required]
});
}
parent. html
<child [parentForm]="form"></child>
child.ts
@Input() parentForm: FormGroup;
child. html
<form [formGroup]="parentForm">
<!-- Here you can access form controls -->
</form>