Experimental Directive
What it does
Inserts an embedded view from a prepared TemplateRef
How to use
<template [ngTemplateOutlet]="templateRefExpression" [ngOutletContext]="objectExpression"> </template>
Class Overview
class NgTemplateOutlet { constructor(_viewContainerRef: ViewContainerRef) ngOutletContext ngTemplateOutlet ngOnChanges() }
Selectors
[ngTemplateOutlet]
Class Description
You can attach a context object to the EmbeddedViewRef
by setting [ngOutletContext]
. [ngOutletContext]
should be an object, the object's keys will be the local template variables available within the TemplateRef
.
Note: using the key $implicit
in the context object will set it's value as default.
Constructor
constructor(_viewContainerRef: ViewContainerRef)
Class Details
ngOutletContext
ngTemplateOutlet
ngOnChanges()
exported from @angular/common/index, defined in @angular/common/src/directives/ng_template_outlet.ts
Please login to continue.