I'm loading data into a form, so if the user wants to change the data they should change the data into input and make a submit, but I have a problem, I can load the data and that's works, but at the momento of get the formControl.Value, I get undefined into the object and I don't understand why, this is my atempt:
Her I init my form and PosibleEditTeam is where I get the values for load.
this.formEditTeam = this._fb.group({
TeamName: new FormControl(this.PosibleEditTeam.Name, [Validators.required]),
ColorMarkerTeam: new FormControl(this.PosibleEditTeam.ColorMark),
and my html form:
<form *ngIf="isVisibleEditTeam" [formGroup]="formEditTeam">
<div class="form-row">
<div class="form-group col-md-6">
<label for="TeamName"
><i class="fa fa-users text-default"></i> Team name</label>
<input
type="text"
class="form-control form-control-sm"
id="TeamName"
name="TeamName"
formControlName="TeamName"
placeholder="Inserta un nombre"
/>
</div>
<div class="form-group col-md-6">
<label for="ColorMarkerTeam"
><i class="fa fa-palette text-default"></i>
Team</label
>
<input
type="color"
class="form-control form-control-sm"
name="ColorMarkerTeam"
formControlName="ColorMarkerTeam"
id="ColorMarkerTeam"
/>
</div>
</div>
</form>
is something wrong with it?, if you think that it's ok and the problem is in another place, please ask for information.