1. Structural and array directives Are 0 removing, or manipulating elements.

Angular consumed the <ng-template> content during its actual rendering and replaced the <ng-template> with a diagnostic comment.

The <ng-template> is an Angular element for rendering HTML. It is never displayed directly. In fact, before rendering the view, Angular replaces the <ng-template> and its contents with a comment.

If there is no structural directive and you merely wrap some elements in a <ng-template> , those elements disappear.

If there are no other structural instructions in the middle of the <ng-template> tag, the element wrapped around the <ng-template> element will disappear from the page.

That’s the fate of the middle “Hip!” In the phrase “Hip! Hip! Hooray!” .

Here’s an example:

<p>Hip!</p>
<ng-template>
  <p>Hip!</p>
</ng-template>
<p>Hooray!</p>
Copy the code

End result:



For more of Jerry’s original articles, please follow the public account “Wang Zixi “: