Using Tippy.js within an Angular component

171 Views Asked by At

I'm trying to bind tooltips to some DOM elements in my component using Tippy.js.

Below is my bare bones example test.component.ts as I'm unable to make it even show up.

import ...
import { ViewChild, ElementRef } from @angular/core;
import tippy from 'tippy.js';

@Component({
selector: 'app-test',
template:
```
<div #testDiv>Hover over me.</div>
```,
styleUrls: []
})
export class TestComponent {
 @ViewChild('testDiv') testDiv: ElementRef;
 tippy(this.testDiv, { content: 'This is tooltip content.' })
}
0

There are 0 best solutions below