Original title: Can’t initialize dynamically appended (HTML) component in Angular 2
I’ve created a directive that appends a modal to the body on initialization. When a button (with the directive injected into it) is clicked this modal fires up. But I want the contents of this modal to be another component (In fact I want the modal to be the component). It seems that I can’t initialize the component.
Here is a plunker of what I’ve done:
I’m trying to make my-comp the template of my component
'<div class="modal-body" #theBody>' + '<my-comp></my-comp>' + '</div>