title: @input is not working for Api response value- angular
body: <p>I am using two components parent component and child component and I want to pass the value from parent to child and I used @input method</p>
  <p><strong>------------------------------When I hardcoded the value----------------------------------</strong></p>
  <p><strong>PARENT COMPONENT</strong></p>
  <p><strong>ts file</strong></p>
  <pre><code>ngOnit(){
      this.name='JOB';
  }
  </code></pre>
  <p><strong>html file</strong></p>
  <pre><code>&lt;app-parent [name]='name'&gt;&lt;/app-parent&gt;
  </code></pre>
  <p><strong>CHILD COMPONENT</strong></p>
  <pre><code>@input name: any
  
  ngOninit(){
     console.log(this.name)
  }
  </code></pre>
  <p><strong>------------------------------ When I passed value from Api----------------------------</strong></p>
  <p><strong>PARENT COMPONENT</strong></p>
  <p><strong>ts file</strong></p>
  <pre><code>ngOnit(){
      getMethod();
  }
  
  getMethod(){
      this.apiService.getAll(data)
        .subscribe(data =&gt; {
          if (data.success) {
              this.name=data.data.name
          }
        });
    }
  }
  </code></pre>
  <p><strong>html file</strong></p>
  <pre><code>&lt;app-parent [name]='name'&gt;&lt;/app-parent&gt;
  </code></pre>
  <p><strong>CHILD COMPONENT</strong></p>
  <pre><code>@input name: any
  
  ngOninit(){
     console.log(name)
  }
  </code></pre>
  <p>Here when console, the value is <em>undefined</em></p>
  <p>Why its not working .Can anybody help me ??</p>