Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70891

Ionic2: [(ngModel)] and (input) in ion-input

$
0
0

@carlosadrian wrote:

Look at this code, please:

<ion-input type="number" [(ngModel)]="data.quantity" (input)="readData(data)"></ion-input>

It first calls readData() and after that it updates data.quantity. In my case it is a problem, because in readData() I want the new value entered by the user, and now it has the old one (the previous value before it changed).

How can I invert that order? I mean first update data.quantity, and once updated, then call readData() with the new value entered by the user.

Thank you

Cordova CLI: 6.1.1
Ionic Framework Version: 2.0.0-beta.6
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS:
Node Version: v4.4.1

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70891

Trending Articles