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 put an amount of money in an input, how do we get it to be formatted correctly?
What I would like 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 the focus in the input it will see "€ 10.20" and in the model we will have "10.2".
Note: I know that I could separate [ngModel]="quantity" 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