Experimental
Directive
Inserts an embedded view from a prepared TemplateRef
<template [ngTemplateOutlet]="templateRefExpression" [ngOutletContext]="objectExpression"> </template>
class NgTemplateOutlet implements OnChanges { constructor(_viewContainerRef: ViewContainerRef) ngOutletContext ngTemplateOutlet ngOnChanges(changes: SimpleChanges) }
[ngTemplateOutlet]
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(_viewContainerRef: ViewContainerRef)
ngOutletContext
ngTemplateOutlet
ngOnChanges(changes: SimpleChanges)
exported from @angular/common/index, defined in @angular/common/src/directives/ng_template_outlet.ts
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v2.angular.io/docs/ts/latest/api/common/index/NgTemplateOutlet-directive.html