projects/wvr-elements/src/lib/shared/directives/wvr-content-projection.directive.ts
Selector | [wvrContentProjection] |
Methods |
Inputs |
constructor(elementRef: ElementRef)
|
||||||
Parameters :
|
template | |
Type : string
|
|
wvrContentProjection | |
Type : ElementRef
|
|
ngAfterViewInit |
ngAfterViewInit()
|
Returns :
void
|
import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core';
import { projectSourceContent } from '../utility';
@Directive({
selector: '[wvrContentProjection]'
})
export class WvrContentProjectionDirective implements AfterViewInit {
@Input('wvrContentProjection') parentElementRef: ElementRef;
/* tslint:disable-next-line:no-input-rename */
@Input('template') template: string;
constructor(private readonly elementRef: ElementRef) {
}
ngAfterViewInit(): void {
projectSourceContent(this.elementRef, this.parentElementRef, `template[${this.template}]`);
}
}