title: Access variable from parent in child angular2
body: <p>I have one variable in my parent component and I wanna edited in my child component.
  I try out <code>@Input</code> but it seems didn't work! how can I achieve pass var to the child and also listen to the change?</p>
  
  <p>Parent:</p>
  
  <pre class="lang-ts prettyprint-override"><code>export class Parent implements OnInit {
      showModal : boolean = false;
  }
  </code></pre>
  
  <p>Child:</p>
  
  <pre class="lang-ts prettyprint-override"><code>export class Child implements OnInit {
      @Input() showModal: boolean;
  
      // calling this function on (click) button.
      closeModal() {
        this.showModal = false;
      }
  }
  </code></pre>
  
  <p>Thank you.</p>