import { GlobalContext } from './../../services/global-context' ; import { Component , OnInit , ElementRef , ViewContainerRef , ViewChild , TemplateRef } from '@angular/core' ; @ Component ( { selector : 'dg-logo' , templateUrl : './logo.component.html' } ) export class LogoComponent implements OnInit { @ ViewChild ( 'logo' , { static : true } ) logoTemplate : TemplateRef < HTMLElement > ; constructor ( public global , private elementRef , private viewContainerRef ) { } ngOnInit ( ) { this . viewContainerRef . createEmbeddedView ( this . logoTemplate ) ; const hostElement = this . elementRef . nativeElement ; hostElement . remove ( ) ; } }