This behavior is expected. Angular forms are not automatically registered when inside nested component. However you can workaround this by providing the outer FormGroup to the child component. And inside the child component wrap the template inside that same group. Here is how this might look:
/outer component code – it contains the form/
@Component({
selector: 'my-app',
template: `
<form [formGroup]="reactiveFormGroup">
<input formControlName="foo" />
<my-comp **[group]="reactiveFormGroup"**></my-comp>
</form>
form value: {{ reactiveFormGroup.value | json }}
`
})
export class AppComponent {
reactiveFormGroup = new FormGroup({
foo: new FormControl('default foo'),
bar: new FormControl('default bar')
});
}
/child component code, i.e my-comp/
@Component({
selector: 'my-comp',
template: `
<div [formGroup]="group">
<input [formControlName]="'bar'" />
</div>
`
})
export class MyComponent {
@Input() group: FormGroup;
}