How to use ng-template ?

Definitions

ng-template

The ` is an Angular element, which contains the template. A template is an HTML snippet. The template does not render itself on DOM.

ng-template-outlet

The ngTemplateOutlet directive allows you to dynamically render templates in your Angular components, which can be very useful for creating reusable and flexible UI components.

ViewChild/ViewChildren and ContentChild/ContentChildren

ViewChild and ViewChildren are used to access the DOM elements or directives from a component template. ContentChild and ContentChildren are used to access the DOM elements or directives from the content of a component.

Table of contents