File

projects/wvr-elements/src/lib/shared/directives/wvr-content-projection.directive.ts

Implements

AfterViewInit

Metadata

Index

Methods
Inputs

Constructor

constructor(elementRef: ElementRef)
Parameters :
Name Type Optional
elementRef ElementRef No

Inputs

template
Type : string
wvrContentProjection
Type : ElementRef

Methods

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}]`);
  }

}

results matching ""

    No results matching ""