title: How to get the amount converted to currency pipe value after getting error message in angular8
body: <p>i am using currency pipe in blur event. But it works fine for the first time, when i get an error message of validation, if i delete few numbers and come out, it wont be formatted to the currency format remains in the format what user have deleted. 
  For example i gave this number: 
  <code>36543265</code> so when i came out of the input it is formatted to <code>$36,543,265.00</code>, with the validation error message. So if i delete 
  <code>265.00</code> from <code>$36,543,265.00</code> , i still have the error validation message. so the validation error message went off and stayed with this format <code>$36,543</code> but it didn't come to the proper format. How do i make it to proper currency pipe format of <code>USD</code>, after clearing the validation message.</p>
  
  <p>How can i make it to be formatted properly based on user deletion of values.</p>
  
  <p>TS:</p>
  
  <pre><code>public transformAmount(element, name) {
    if (name == "amount") {
      let formattedAmount = this.currencyPipe.transform(this.eoInfoForm.value.amount, 'USD');
      element.target.value = formattedAmount;
      this.eoInfoForm.get('amount').setValue(formattedAmount);
      if (this.eoInfoForm.get('amount').status === 'VALID') {
        this.amt = false; 
      } 
      else {
        this.amt = true;
      } 
    } 
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code> &lt;input type="text" class="form-control" placeholder="Amount in dolars"
                      formControlName="amount" autocomplete="off" maxlength="8" allowNumberOnly (blur)="transformAmount($event,'amount')" [ngClass]="{ 'is-invalid': amt  &amp;&amp; eoInfo.amount.invalid }"&gt;
                      &lt;div *ngIf="amt &amp;&amp; eoInfo.amount.invalid" class="invalid-feedback"&gt;
                          &lt;div *ngIf="amt &amp;&amp; eoInfo.amount.invalid"&gt;Maximum of 8 characters including $ is allowed&lt;/div&gt;
                        &lt;/div&gt;
  </code></pre>
  
  <p>DEMO:
  <a href="https://stackblitz.com/edit/angular-wkuees?file=src%2Fapp%2Fapp.component.ts" rel="nofollow noreferrer">DEMO</a></p>