title: Angular 5: Passing an array from child to parent component
body: <p>I have a child and a parent component.</p>
  
  <p>I want to pass an array from the child component and display it in the parent component.</p>
  
  <p>I first started with:</p>
  
  <pre><code>@Input data: string[];
  </code></pre>
  
  <p>Then in <code>ngOnInit</code> I have:</p>
  
  <pre><code>ngOnInit() {
     this.data = ['name1', 'name2', 'name3'];
  }
  </code></pre>
  
  <p>Then I have the parent component:</p>
  
  <pre><code>&lt;app.parent&gt;&lt;/app.parent&gt;
  </code></pre>
  
  <p>My question is: how do I display this data in the parent component?</p>