UNPKG

ng2-bootstrap-base-modified

Version:

Native Angular Bootstrap Components Typeahead modified

30 lines (24 loc) 674 B
import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core'; @Directive({ selector: '[ngTransclude]' }) export class NgTranscludeDirective { public viewRef:ViewContainerRef; protected _viewRef:ViewContainerRef; protected _ngTransclude:TemplateRef<any>; @Input() public set ngTransclude(templateRef:TemplateRef<any>) { this._ngTransclude = templateRef; if (templateRef) { this.viewRef.createEmbeddedView(templateRef); } } public get ngTransclude():TemplateRef<any> { return this._ngTransclude; } public constructor(viewRef:ViewContainerRef) { this.viewRef = viewRef; } }