Please enable JavaScript.
Coggle requires JavaScript to display documents.
Advance Angular - Coggle Diagram
Advance Angular
ng-container
ng-container allows us to create a division or section in a template without introducing a new HTML element. The ng-container does not render in the DOM, but content inside it is rendered. ng-container is not a directive, component, class, or interface, but just a syntax element.
-
ng-template
<ng-template> is an Angular element, which contains the template. A template is an HTML snippet. The template does not render itself on DOM
-
-
ng-content
Content projection is a way to pass the HTML content from the parent component to the child component
-
ngTemplateOutlet
ngTemplateOutlet is a structural directive. We use it to insert a template (created by ngTemplate) in various sections of our DOM
(ng-template) The template does not render itself. We must use a structural directive to render it. That is what ngTemplateOutlet does
<ng-template let-name="nameVar" let-message="messageVar" #template3> <p>Dear {{name}} , {{message}} </p></ng-template>
<ng-container [ngTemplateOutlet]="templates" [ngTemplateOutletContext] ="{nameVar:'Guest',messageVar:'Welcome to our site'}"></ng-container>