title: Using @input property in child component to call service in angular 2
body: <p>Communication data from parent component to child component using @input in angular 2. My purpose is I want to call service in child component using value parameter @input, but the value property is "undefine". this is my child component :</p>
  
  <pre><code>import { Component, OnInit,  EventEmitter, Input,Output } from     '@angular/core';
  
  @Component({
      selector: 'app-child', 
      templateUrl: './child.component.html'
  })
  
  export class ChildComponent  implements OnInit {
  
  
      @Input() productId: any; --&gt; working perfectly if bind into html
  
      constructor() {
  
      }
  
      ngOnInit(): void {
          console.log(this.productId) --&gt; undefine?
      //in this methode i will call service to fetch another data from database using parameter productId..
  
  
      }
  }
  </code></pre>
  
  <p>How to solve this?</p>