Ion-input with type=number returning value as string


#1

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!


#2

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


#3

i also met this question


#4

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