title: Angular 7 FormControl on valueChanges get old value
body: <p>I got a formControl passed in <code>@Input</code> parameter that is bounded to input of number type that maximum value should be 10.
   When user types number that is bigger it should not change input value.</p>
  
  <p>What is the way to either prevent event propagation or get old value and set it again?</p>
  
  <p>I tried many other solutions from stack and github, but nothing solves my problem. </p>
  
  <pre class="lang-ts prettyprint-override"><code> valuecontrol: FormControl = new FormControl(0);
  
    constructor(){
      this.control.valueChanges.pipe(distinctUntilChanged()).subscribe(newValue=&gt;{
        if(newValue &gt;= 10){
          // set previous value
          const oldValue = this.control.value;
          console.log("old value = ", oldValue)
          this.control.patchValue(oldValue);
        }
      })
    }.
  </code></pre>
  
  <p>DEMO: <a href="https://stackblitz.com/edit/angular-6ocjfj?file=src/app/app.component.ts" rel="noreferrer">https://stackblitz.com/edit/angular-6ocjfj?file=src/app/app.component.ts</a></p>