Suggest an editImprove this articleRefine the answer for “What does <ng-container> do?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**`<ng-container>`** in Angular is a virtual container that does not create an additional element in the DOM, but allows grouping elements and applying structural directives to them (`*ngIf`, `*ngFor`, etc.). **Key point:** `<ng-container>` is a logical container for template markup that does not affect the DOM, but gives Angular the ability to apply directives and variables to a group of elements.Shown above the full answer for quick recall.Answer (EN)ImageIn Angular, `<ng-container>` is a **virtual container** that **does not create an additional element in the DOM**, but allows grouping elements and applying structural directives to them (`*ngIf`, `*ngFor`, etc.). ## Main points 1. **No rendering of its own**: ```html <ng-container *ngIf="isVisible"> <p>Element 1</p> <p>Element 2</p> </ng-container> ``` - If `isVisible = true`, both `<p>` elements are displayed. - The `<ng-container>` **tag is not created** in the DOM, only the `<p>` elements themselves. 2. **Grouping with directives**: - Allows applying a directive to several elements at once. - Without `<ng-container>`, you would have to wrap them in a `<div>` or another tag, creating an extra structure. 3. **Used with** `ng-template` **and local variables**: ```html <ng-container *ngFor="let item of items"> <p>{{ item.name }}</p> </ng-container> ``` - Iteration works without adding an extra wrapper element. In summary: `<ng-container>` is a **logical container for template markup** that **does not affect the DOM**, but gives Angular the ability to apply directives and variables to a group of elements.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.