У меня есть массив json, который может содержать либо компонент, либо селектор html для компонента, который я хочу загрузить. Я пытаюсь загрузить эти данные внутри цикла for. Когда я пытаюсь интерполировать значение {{d.html}}, оно отображается как текст плана. Когда я использую подход innerHTML ниже и проверяю дом, я вижу там html, но он не ведет себя как пользовательский компонент (дом будет просто содержать вместо его инициализации и замены его шаблоном компонентов.
Я посмотрел на загрузчик динамического контента, но он не подходит. Это в цикле for и поэтому не может использовать синтаксис шаблона, поэтому loadIntoLocation не будет работать для меня. Также не уверен, как это будет работать, если компонент будет иметь какие-либо входные данные.
<div *ngFor="#d of dtabs" class="tab-pane" id="tab-{{d.component}}">
<div [innerHTML]="d.html"></div>
</div>