NgTemplateOutlet

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 implements OnChanges {
  constructor(_viewContainerRef: ViewContainerRef)
  
  
  ngOutletContext 
  ngTemplateOutlet 
  ngOnChanges(changes: SimpleChanges)
}

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(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