How can I prevent the <app-componentName>
tag from being added to Angular HTML output? Let me explain what I mean with an example:
I have a chat-box and a message component
like this:
<div class="chatbox">
<app-message-component
*ngFor="let message of messages" [myInput]="message">
</app-message-component>
</div>
after I serve
or build
the output in HTML is:
<div class="chatbox">
<app-message-component>
<div> message 1 </div>
</app-message-component>
<app-message-component>
<div> message 2 </div>
</app-message-component>
...
</div>
But I want it to be this: (Without <app-message-component>
s):
<div class="chatbox">
<div> message 1 </div>
<div> message 2 </div>
...
</div>
Note that this was "an example" to explain the problem and this particular example has a variety of solutions (for example, I can write ngFor inside the component, but this is not my question).
My question is how does <app-componentName>
not appear in the HTML output generally?