<div class="col-md-4">
<form [formGroup]="uploadForm" (ngSubmit)="onSubmit(uploadForm.organization)">
<fieldset class="form-group">
<label class="control-label" for="email">
<h6 class="text-success">Contact Email</h6>
</label>
<div class="input-group">
<div class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></div>
<input type="email" class="form-control" [(ngModel)]='organization.ContactEmail' placeholder="Contact Email" />
</div>
</fieldset>
</form>
</div>
CustomComponent.html:18 ERROR Message: The ngModel directive is not compatible with the parent formGroup directive. Please use the "formControlName" directive of formGroup instead. For example:
<div [formGroup]="myGroup"> <input formControlName="firstName"> </div>
In your TypeScript class:
this.myGroup = new FormGroup({ firstName: new FormControl() });
Alternatively, if you want to use ngModel but indicate it as standalone, you can do so using ngModelOptions:
Example:
<div [formGroup]="myGroup"> <input formControlName="firstName"> <input [(ngModel)]="showMoreControls" [ngModelOptions]="{standalone: true}"> </div>