Essentially, I am updating a user profile with user information that needs to be bound to the corresponding fields.
this.editOfferprice= new FormGroup({
xyz : new FormControl(xxxx,[]),
xxx: new FormControl(xxxx,[Validators.required]),
wwwID : new FormControl(xxxx,[Validators.required]))};
The above code utilizes formgroup and formcontrol.
<mat-form-field fxFlex="49"> <mat-select placeholder="Select xxx" formControlName="xxx"> <mat-option *ngFor="let P of Pro" [value]="P.ID"> {{P.Name}} </mat-option> </mat-select> <mat-error *ngIf="editOffer.controls['xxx'].errors && editOfferprice.controls['xxx'].errors.required"> You must select Name</mat-error> </mat-form-field>
I am trying to figure out how to bind data to a dropdown.