ng2-bootstrap-base-modified
Version:
Native Angular Bootstrap Components Typeahead modified
30 lines (24 loc) • 674 B
text/typescript
import {
Directive, Input, TemplateRef, ViewContainerRef
} from '@angular/core';
export class NgTranscludeDirective {
public viewRef:ViewContainerRef;
protected _viewRef:ViewContainerRef;
protected _ngTransclude:TemplateRef<any>;
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;
}
}