title: Call function in child component defined in parent component angular 2
body: <p>I have two components app and child. in child component I have button on click of which I am calling a function (function name is assigned to a variable which make it dynamic) which is defines in app component. But this is not working. Any help?</p>
  
  <p><strong>app.ts</strong></p>
  
  <pre><code>selector: 'my-app',
  template: `
    &lt;div&gt;
      &lt;h2&gt;Hello {{name}}&lt;/h2&gt;
      &lt;child-comp&gt;&lt;/child-comp&gt;
      &lt;p&gt;{{data}}&lt;/p&gt;
    &lt;/div&gt;
  `,
  })
  export class App {
    name:string;
    data: string;
    constructor() {
      this.name = 'Angular2'
    }
    dummyFunction(){  // I want to call this function
        data = "function called";
    }
  }
  </code></pre>
  
  <p><strong>Child.ts</strong></p>
  
  <pre><code>@Component({
    selector: 'child-comp',
    template: `
      &lt;input type="button" value="click me" (click) = [funcName]()&gt;  // Here I am calling the function which is assign to a variable
    `,
  })
  export class ChildComp {
    funcName: string;
    constructor() {
      funcName = 'dummyFunction';  // assigning function name to variable
    }
  }
  </code></pre>
  
  <p><a href="https://plnkr.co/edit/WsWK8O9iXDHLJHe2lRwX" rel="nofollow noreferrer">Attaching Plunker</a></p>