CodeZettaInterview Hub

Angular · Templates · Fresh / Intern · Comparison

What is ng-template and how does it differ from ng-container?

Short Interview Answer

ng-template is an inert template definition; ng-container groups without a DOM element.

Detailed Explanation

ng-template content renders only when stamped (ngIf else, ngTemplateOutlet). ng-container is for structural directives without extra wrappers. Don't confuse with <template> HTML element semantics alone.

Did you know this answer?