NetanelBasal
8/21/2017 - 8:56 AM

tooltip-angular4.ts

  @HostListener('mouseenter')
  mouseenter() {
    if ( this.componentRef ) return;
    const factory = this.resolver.resolveComponentFactory(TooltipComponent);
    const injector = ReflectiveInjector.resolveAndCreate([
      {
        provide: 'tooltipConfig',
        useValue: {
          host: this.element.nativeElement
        }
      }
    ]);
    this.componentRef = this.vcr.createComponent(factory, 0, injector, this.generateNgContent());
  }