title: Angular 4 - Remove current dynamic component programmatically
body: <p>I have created some dynamic components like -</p>
  
  <pre><code>&lt;div&gt;
    &lt;ang-textfield&gt;&lt;/ang-textfield&gt;
    &lt;ang-textarea&gt;&lt;/ang-textarea&gt;
    &lt;ang-checkbox&gt;&lt;/ang-checkbox&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Within specific <code>dynamic component</code> there are some elements like -</p>
  
  <pre><code>&lt;ang-textfield&gt;
    &lt;input type="text" /&gt;
    &lt;button&gt;Settings&lt;/button&gt;
    &lt;button (click)="remove_component()"&gt;Remove&lt;/button&gt;
  &lt;/ang-textfield&gt;
  </code></pre>
  
  <p>I want to remove current component after clicking <code>Remove</code> button.</p>
  
  <p>How can i do that?</p>
  
  <p><strong>Here is the <a href="https://plnkr.co/edit/pW7Zsy6s73lHgJHLO0lC" rel="nofollow noreferrer">plunker</a></strong></p>