title: Input box with pipe does not update value when space is removed
body: <p>I have created a pipe to format the value in the input box as follows:</p>
  
  <blockquote>
    <p>1 123</p>
    
    <p>10 123</p>
    
    <p>101 123</p>
    
    <p>2 101 123</p>
    
    <p>23 101 123</p>
    
    <p>123 101 123</p>
  </blockquote>
  
  <p>The pipe gives the desired output when I type into the input box or hit backspace.</p>
  
  <p><strong>Issue:</strong> The input box does not update when I remove a space from the Input box.</p>
  
  <p>e.g. If I changed value from 123 123 to 123123 the input box does not update.</p>
  
  <p>The pipe:</p>
  
  <pre><code>@Pipe({name: 'formatCurrency'})
  export class FormatCurrencyPipe implements PipeTransform{
  
      transform(value: string): string {
          //convert to string
          value = value.toString();
  
          // remove spaces
          value = value.replace(/ /g,'');
          console.log('Spaces removed');
          console.log(value);
  
          // add spaces
          value = value.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
          console.log('Spaces Added');
          console.log(value);
  
          return value;
      }
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input type="text" (keypress)="disableSpace($event)" [ngModel]="data.value | formatCurrency" (ngModelChange)="data.value = $event" /&gt;
  </code></pre>
  
  <p>Component:</p>
  
  <pre><code>export class App implements OnInit {
    name:string;
    data:any = {value: 123345};
    constructor() {}
  
    ngOnInit(): void {
       this.name = 'Angular2';
    }
  
    disableSpace(event: any) {
        if (event.charCode &amp;&amp; event.charCode === 32 || event.which &amp;&amp; event.which === 32) {
            event.preventDefault();
        }
    }
  }
  </code></pre>
  
  <p>Plunker: <a href="https://plnkr.co/edit/j5tmNxllfZxP0EDp2XgL?p=preview" rel="nofollow noreferrer">https://plnkr.co/edit/j5tmNxllfZxP0EDp2XgL?p=preview</a></p>
  
  <p>Any idea why this behavior and how to fix/approach this problem?</p>