matheus
matheus

Reputation: 1

i can't use interpolation in my Angular app

this is the code, i'm trying to use interpolation on my input, but it just don't work, tried setting the value of the input the same as the User username, but none of these worked

<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-menu-button></ion-menu-button>
    </ion-buttons>
    <ion-title>Meus dados</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>

  <form *ngIf="let user of User">

    <ion-item lines="full" class="formItem">
      <ion-label position="floating">{{user.Username}}</ion-label>
      <ion-input type="text" required></ion-input>
    </ion-item>
   
    <ion-row>

      <ion-col>
        <ion-button type="submit" color="primary" expand="block" [routerLink]="['/']">Salvar</ion-button>
      </ion-col>

    </ion-row>
  </form>

</ion-content>

Upvotes: 0

Views: 41

Answers (1)

Jos&#233; Matos
Jos&#233; Matos

Reputation: 1

It should be something like this:

<ion-input value="{{user.Username}}"></ion-input>

or

<ion-input [value]="user.Username"></ion-input>

Upvotes: 0

Related Questions