title: AngularJS - How to apply currency filter on textbox as I type?
body: <p>My project has a requirement to show amount field in currency format. I can achieve this <code>onblur</code> event, but let me know if this can be achieved using filters or some other AngularJS technique.</p>
  
  <p>I have the following textbox:</p>
  
  <pre><code>&lt;input type="text" class="form-control" id="MyAmount" name="MyAmount" ng-model="MyAmount" /&gt;
  </code></pre>
  
  <p>I want to convert the value inside this text box to follow currency format. So, if I type 200000, it should make is $200,000.00 as soon as I type or while I am typing.</p>
  
  <p>I used the following technique and applied a filter, </p>
  
  <pre><code>&lt;input type="text" class="form-control" id="MyAmount" name="MyAmount" ng-model="MyAmount"
                              value="{{MyAmount | currency}}" /&gt;
  </code></pre>
  
  <p>but it only converts for the first key I type, like it converts 2 to $2.00 and then it clears the value (as I guess it finds this updated value as not a number?)</p>
  
  <p>Update: I am able to format it live using a custom filter, but that filter is not working properly in all the cases and when I save the value, I am getting values with $ and commas in the amount and not just the numeric value. I will try more.</p>