Have a similar situation but the fix above does not work. Here is the directory tree in my case. The form is subcomponent to the app.
The app.component.html:
<div class="jumbotron">
<div class="container">
<h1>Simple Curl request</h1>
</div>
</div>
<div class="container">
<app-form></app-form>
</div>
which is basically calling the subcomponent 'form'. And within the we call [formGroup] and similar error as above happens.
It fails with error:
Can't bind to 'formGroup' since it isn't a known property of 'form'."
The form.component.ts contains the header :
import { FormBuilder, Validators, FormGroup, FormControl } from '@angular/forms';
The form.component.html contains:
<div class="card-block"> |
<form [formGroup]="cform" (ngSubmit)="doRequest($event)"> |
<div class="card form-group"> |
<div class="card-header"> |
Authentication |
</div> |
<div class="card-block"> |
<div class="form-group" formGroupName="authentication"> |
<label for="">Type</label> |
<select formCon ....
And there you see the formGroup mentioned.... Functionally there is no problem but the testcases fails...... Why ????????