Ion-input with type=number returning value as string

Hey guys!

I recently noticed that the binding model on ion-input with type=“number” is bound as a string rather than a number. I’m not sure if this is intended, but I feel like the appropriate behavior would be to bind the value as a number.

private amount: number;  // In component
<ion-input type="number" [(ngModel)]="amount"></ion-input>  // In template

amount = "55" // in my console output

I’m using Ionic 2 Beta 10. If this is an issue I’m happy to file it. Thanks!

1 Like

What i tried is giving me its typeOf as number only.

i also met this question

Known issue: https://github.com/driftyco/ionic/issues/7121