title: How can i access the values from parent component in angular2 using dependency injection?
body: <p>I have two components one parent and a child i want to access a variable in parent component from child using DI but i am not getting that.i have made a plunker demo <a href="http://plnkr.co/edit/fcfweLJAmadKVWKXF25l?p=preview" rel="nofollow">http://plnkr.co/edit/fcfweLJAmadKVWKXF25l?p=preview</a>  ... I tried to access the value of variable from child and got corrrectly but not from parent to child.This is how i am accessing variable in child component</p>
  
  <pre><code>@Component({
    selector: 'child',
    providers:[AppComponent]
    template: '&lt;h1&gt;My second Angular 2 App&lt;/h1&gt;'
  })
  class NameComponent {
    name:string;
    constructor(AppComponent: AppComponent) {
      this.name = AppComponent.getName();
      console.log(this.name);
    }
  }
  </code></pre>
  
  <p>I want to know is it possible to access variable from parent using DI? some body please tell me how to get the values</p>