title: How do I inject a parent component into a child component?
body: <p>I'm trying to inject a parent component into a child component.  I thought this would be straightforward &ndash; simply specify/inject the parent component in the child's <code>constructor()</code>:</p>
  
  <pre><code>constructor(private _parent:AppComponent) {}   // child component constructor
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>EXCEPTION: Cannot resolve all parameters for ChildComponent(?). Make sure they all have valid type or annotations.</p>
  </blockquote>
  
  <p>What am I missing?</p>
  
  <p>ChildComponent:</p>
  
  <pre><code>import {Component} from 'angular2/core';
  import {AppComponent} from './app.component';
  
  @Component({
    selector: 'child',
    template: `&lt;p&gt;child&lt;/p&gt;`
  })
  export class ChildComponent {
    constructor(private _parent:AppComponent) {}
  }
  </code></pre>
  
  <p>AppComponent:</p>
  
  <pre><code>import {Component} from 'angular2/core';
  import {ChildComponent} from './child.component';
  
  @Component({
    selector: 'my-app',
    template: `{{title}} &lt;child&gt;&lt;/child&gt;
    `,
    directives: [ChildComponent]
  })
  export class AppComponent {
    title = "Angular 2 - inject parent";
    constructor() { console.clear(); }
  }
  </code></pre>
  
  <p><a href="http://plnkr.co/edit/amg356Bv1Pd0WjPJibvG?p=preview" rel="noreferrer">Plunker</a></p>