When we want to format a tag in Angular2 as a currency we use the Pipe Currency:
<p>{{cantidad | currency}}</p>
That works perfectly, but if what we want is for the user to enter an amount of money in an input, how do we make it format correctly?
What you would want is something like this (this example does NOT work of course):
<input [(ngModel)]="cantidad | currency"></ion-input>
And the expected behavior would be that even if the user types "10.2", when the input loses focus on the input we see "€10.20" and in the model we have "10.2".
Note: I know that I could separate [ngModel]="amount" on the one hand and handle the event (change) or the (ngModelChange) on the other hand, but I was looking for a more elegant and comfortable solution.
Thank you very much