Send form with hidden field Angular 6


I try to send a form that contains a typo hidden input, which I need to contain a value. I do it this way:

<ion-input type="text" [(ngModel)]="userData.token"></ion-input>
<ion-input type="password" [(ngModel)]="userData.new_pass"></ion-input>
<ion-input [(ngModel)]="userData.id_user" type="hidden" value="{{userDetails.id_user}}"></ion-input>

In my ts file I have the following:

userData = {"token":"","new_pass":"","id_user":""};

The problem is that the field sends me but without any value, the server arrives empty.

I've been looking for a way to do it but I can not find how to assign that value to the hidden field.

asked by Alejo Mendoza 05.12.2018 в 03:17

0 answers