import { NgModule , Directive , Input , TemplateRef , ViewContainerRef , OnInit } from '@angular/core' ; export class NgLetContext { $implicit : any = null ; ngLet : any = null ; } @ Directive ( { selector : '[ngLet]' , } ) export class NgLetDirective implements OnInit { private context = new NgLetContext ( ) ; @ Input ( ) set ngLet ( value ) { this . context . $implicit = this . context . ngLet = value ; } constructor ( private vcr , private templateRef ) { } ngOnInit ( ) { this . vcr . createEmbeddedView ( this . templateRef , this . context ) ; } }