title: How to detect Angular life cycle hook OnChanges
body: <p>In this simple component with only one input box and two-way binding I wanted to test OnChanges life cycle hook by logging to  console when I type into input. ngOnChanges is not logging to console.  ngOnInit is. What is the best way to make it work?</p>
  <pre class="lang-typescript prettyprint-override"><code>import { Component, SimpleChange } from '@angular/core';
  
  @Component({
    template: `
      &lt;div&gt;
        hello life
        &lt;input type=&quot;text&quot; placeholder=&quot;hassan&quot; [(ngModel)]=&quot;name&quot; /&gt;
        &lt;p&gt;my name is:{{ name }}&lt;/p&gt;
      &lt;/div&gt;
    `,
    selector: 'hook-life',
  })
  export class LifeCycleComponent {
    name: string = '';
    constructor() {
      console.log('constructor ');
    }
  
    ngOnChanges(c: SimpleChange) {
      console.log(`onchanges ${c.currentValue} `);
    }
  
    ngOnInit() {
      console.log('onInit');
    }
  
    ngOnDestroy() {
      console.log('onDestroy');
    }
  }
  </code></pre>