| 1234567891011121314151617181920212223242526272829303132333435 |
- import {
- Directive,
- ViewContainerRef,
- ComponentFactoryResolver,
- Renderer2,
- ElementRef,
- } from '@angular/core';
- // import { TooltipComponent } from 'src/app/shared-components/tooltip/tooltip/tooltip.component';
- @Directive({
- selector: '[tooltip]',
- standalone: true,
- })
- export class TooltipDirective {
- constructor(
- private viewContainerRef: ViewContainerRef,
- private componentFactoryResolver: ComponentFactoryResolver,
- private renderer: Renderer2,
- private el: ElementRef,
- ) {
- // this.showTooltip();
- }
- // showTooltip() {
- // const factory =
- // this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);
- // const componentRef = this.viewContainerRef.createComponent(factory);
- // componentRef.instance.content = 'This is a tooltip';
- // this.renderer.appendChild(
- // this.el.nativeElement,
- // componentRef.location.nativeElement,
- // );
- // }
- }
|