Skip to content
This repository has been archived by the owner on May 20, 2019. It is now read-only.

Nested components in dynamic template not rendered #35

Open
Igneous01 opened this issue Aug 10, 2018 · 0 comments
Open

Nested components in dynamic template not rendered #35

Igneous01 opened this issue Aug 10, 2018 · 0 comments

Comments

@Igneous01
Copy link

Igneous01 commented Aug 10, 2018

This is my html - in the first section I have a container component and a child container component nested inside (container component has <ng-content> inside it's html). So it renders some simple text and the child renders a list of items.

<div style="background-color: #888">
  <h1>STATIC TEMPLATE DEFINITION</h1>
  <app-my-container>
    <app-my-child-container [items]="['A', 'B', 'C']" [text]="'TEST'"></app-my-child-container>
  </app-my-container>
</div>

<div style="background-color: #CCC">
  <h1>DYNAMIC TEMPLATE FROM MANUAL HTTP GET</h1>
  <dynamic-html [content]="template" *ngIf="STATE == 1"></dynamic-html>
</div>

However in the second example, the dynamic template only loads the <app-my-container> component, and none of it's children. The data inside template looks like so:

<app-my-container>
  <app-my-child-container [items]="['Apples', 'Bananas', 'Charlies', 'Deltas']" [text]="'2512'"></app-my-child-container>
</app-my-container>

Is there anyway to get nested components to load within a dynamic template? I am using latest angular 6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant