Project

General

Profile

1
/**
2
 * Created by stefanos on 15/5/2017.
3
 */
4
import { AfterViewInit, Directive, TemplateRef, ViewContainerRef } from '@angular/core';
5

    
6
@Directive({
7
  selector: '[my-form]',
8
})
9
export class MyFormDirective implements AfterViewInit {
10

    
11
  constructor(public viewContainerRef: ViewContainerRef, public templateRef: TemplateRef<any>) {}
12

    
13
  ngAfterViewInit(): void {
14
    this.viewContainerRef.createEmbeddedView(this.templateRef);
15
  }
16
}
(2-2/4)