hi I'm doing a form using angular which contains the following data
<form >
<input type="text" placeholder="Nombres: "
[(ngModel)]="nombres" [ngModelOptions]="{standalone: true}" name="nombres"><br>
<input type="text" placeholder="Apellidos: "
[(ngModel)]="apellidos" [ngModelOptions]="{standalone: true}" name="apellidos"><br>
<input type="email" placeholder=" Correo: "
[(ngModel)]="correo" [ngModelOptions]="{standalone: true}" name="correo"><br>
<label> Necesitas Servico (de mesero) </label> <br>
<mat-radio-button [(ngModel)]="servicio" [ngModelOptions]="{standalone: true}"
name="servicio" value="si"
(ngModelChange)="servicio= $event">Si</mat-radio-button>
<mat-radio-button [(ngModel)]="servicio" [ngModelOptions]="{standalone: true}"
name="servicio" value="no"
(ngModelChange)="servicio= $event">No</mat-radio-button><br><br>
<button class="btn-guardar" type="submit" (click)="enviarmail()">Enviar</button>
</form>
I have two ngModel with the same name, when I send the data with the sendmail () function, the service field is sent as undefined.
How can I solve this.
Thanks