title: angular5 dynamic compoments parent-chld communication
body: <p>I'm implementing the approach described in <a href="https://angular.io/guide/dynamic-component-loader" rel="nofollow noreferrer">the dynamic compoment docs</a>.</p>
  
  <p>I need my dynamic components to be able to emit an event to the parent component and in response the parent component might need to call a method of the child component.</p>
  
  <p>I know how to bind child events to a parent's method when the child component is in the parent's template:</p>
  
  <ul>
  <li><code>@Output() xevent : eventEmitter&lt;string&gt;;</code> in child</li>
  <li><code>&lt;child-comp (xevent)="aParentMethod($event)"</code> in parent template</li>
  </ul>
  
  <p>However in the dynamic component approach, the parent template contains a directive, which in turn will wrap the dynamically instantiated component.</p>
  
  <p>How can I set @Input and @Output properties on the dynamic component and propagate them from parent to child and vice-versa?</p>
  
  <p>Moreover, how can I have the parent call a method on the child?</p>