I am trying to bind a form item to an object without using ngModel. But it is not working.
I tried using the [(value)]="" attribute. However, the initial value of the element changed to "undefined".
https://material.angular.io/components/input/overview
<mat-form-field class="col-md-4">
<input matInput placeholder="First name" formControlName="firstCtrl" [(value)]="formData.firstName">
<mat-error>First name can not be left blank</mat-error>
</mat-form-field>
formData = new RawFormData;
But this one is working correctly:
<mat-form-field>
<mat-select placeholder="Title" formControlName="titleCtrl" [(value)]="formData.gender">
<mat-option *ngFor="let title of personalTitle" [value]="title.value">{{title.viewValue}}</mat-option>
</mat-select>
</mat-form-field>