title: Angular2. Can I use ViewChild and @Input at the same time?
body: <p>I need to transfer some data into child element and run function in it.
  I use <code>ViewChild</code> for access to the function. But in child <code>childParam</code> still undefined.</p>
  
  <p>Parent template:</p>
  
  <pre><code>&lt;my-modal #myModal [childParam]="parentParam"&gt;&lt;/my-modal&gt;
  </code></pre>
  
  <p>Parent component:</p>
  
  <pre><code>@ViewChild('myModal') myModal;
  parentParam: any;
  
  onSubmit(value: any){
    this.parentParam = value;
    this.myModal.modalShow();
  }
  </code></pre>
  
  <p>Child component:</p>
  
  <pre><code>@Input() childParam: any;
  
  modalShow(){
    console.log(this.childParam);
  }
  </code></pre>
  
  <p>Why <code>childParam</code> is undefined?</p>
  
  <p>What is better: change directly <code>childParam</code> by <code>ViewChild</code>:</p>
  
  <pre><code>this.myModal.childParam = 'test string';
  </code></pre>
  
  <p>or send data through function parameters:</p>
  
  <pre><code>this.myModal.modalShow('test string');
  </code></pre>