title: Detect when input value changed in directive
body: <p>I'm trying to detect when the <strong>value</strong> of an input changed in a directive. I have the following directive:</p>
  
  <pre class="lang-js prettyprint-override"><code>    import { ElementRef, Directive, Renderer} from '@angular/core';
  
      @Directive({
          selector: '[number]',
          host: {"(input)": 'onInputChange($event)'}
      })
  
      export class Number {
  
          constructor(private element: ElementRef, private renderer: Renderer){
  
          }
          onInputChange(event){
              console.log('test');
          }
      }
  </code></pre>
  
  <p>The problem in this directive is that it detects only when there is an input and not when the value changes programatically. I use reacive form and sometimes I set the value with the <code>patchValue()</code> function. How can I do so the change function gets triggered?</p>