Angular 10 NgTemplateOutlet Directive
In this article, we are going to see what is NgTemplateOutlet in Angular 10 and how to use it.
The NgTemplateOutlet in Angular10 is used to insert an embedded view from a prepared TemplateRef. NgTemplateOutlet adds the reference element which is displayed on the page.
NgModule: Module used by NgTemplateOutlet is:
- Create an angular app to be used.
- There is no need for any import for the NgIf to be used.
- in app.component.html add NgTemplateOutlet Directive to the element with its reference.
- Serve the angular app using ng serve to see the output.