Answer the question
In order to leave comments, you need to log in
How to display nested divs in an element?
Hello. This is an Angular question. If I have two components: A (parent) and B (child)
And there is code like this:
A.html
<h1>Hello world!</h1>
<B>
<div>
<p>Element declarated from parent</p>
</div>
</B>
<div>
<p>Hello from B</p>
{{EmbededTags}}
</div>
Answer the question
In order to leave comments, you need to log in
NgContent? In general, I didn’t really understand anything from the question, but here it is:
a.component.html
<h1>Hello world!</h1>
<b-component>
<div>
<p>Element declarated from parent</p>
</div>
</b-component>
<div>
<p>Hello from B</p>
<ng-content></ng-content>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question