Оригинальный заголовок: невозможно инициализировать динамически добавленный (HTML) компонент в Angular 2
Я создал директиву, которая добавляет модальность к телу при инициализации. Когда нажата кнопка (с введенной в нее директивой), этот модал срабатывает. Но я хочу, чтобы содержимое этого модала было другим компонентом (на самом деле я хочу, чтобы модальный был компонентом). Кажется, что я не могу инициализировать компонент.
Вот плункер того, что я сделал:
http://plnkr.co/edit/vEFCnVjGvMiJqb2Meprr?p=preview
Я пытаюсь сделать my-comp шаблоном моего компонента
'<div class="modal-body" #theBody>'
+ '<my-comp></my-comp>' +
'</div>