Guest User

Untitled

a guest
Nov 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <ng-template #element>
  2. <div style="border:solid 3px yellow;width:250px;
  3. height:250px;position:relative;top:0px;">
  4. this is my element
  5. </div>
  6.  
  7. </ng-template>
  8. <ng-container #template>
  9.  
  10. </ng-container>
  11.  
  12. @ViewChild('element', { read: TemplateRef }) element: TemplateRef<any>;
  13. @ViewChild('template', { read: ViewContainerRef }) template: ViewContainerRef;
  14.  
  15. ngAfterViewInit() {
  16. this.template.createEmbeddedView(this.element);
  17. }
  18.  
  19. @ViewChild('element', { read: ElementRef }) element: ElementRef;
Add Comment
Please, Sign In to add comment