In my project, there is a requirement to specify the amount field in the currency format. I can achieve this event onblur, but let me know if this can be done using filters or some other AngularJS methods.
I have the following text box:
<input type="text" class="form-control" id="MyAmount" name="MyAmount" ng-model="MyAmount" />
I want to convert the value inside this text box to follow the currency format. So, if I type 200,000, he should make $ 200,000.00 as soon as I type or while I type.
I used the following technique and applied a filter,
<input type="text" class="form-control" id="MyAmount" name="MyAmount" ng-model="MyAmount"
value="{{MyAmount | currency}}" />
but it is converted only for the first key I, for example, it converts 2 to $ 2.00, and then clears the value (I suppose it finds this updated value as not a number?)
: , , , $ , . .