@@ -42,24 +42,22 @@ If you're using v1 and don't want to migrate, you can find it [here](https://git
4242npm install @ngneat/helipopper @ngneat/overview
4343```
4444
45- It will automatically add the ` TippyModule ` to your ` AppModule ` . You can configure it as shown below:
45+ Configure it as shown below:
4646
4747``` ts
48- import { TippyModule , tooltipVariation , popperVariation } from ' @ngneat/helipopper' ;
49-
50- @ NgModule ( {
51- declarations : [AppComponent ],
52- imports: [ TippyModule . forRoot ({
53- defaultVariation: ' tooltip' ,
54- variations: {
55- tooltip: tooltipVariation ,
56- popper: popperVariation ,
57- }
58- })],
59- bootstrap: [ AppComponent ]
48+ import { provideTippyConfig , tooltipVariation , popperVariation } from ' @ngneat/helipopper' ;
49+
50+ bootstrapApplication ( AppComponent , {
51+ providers : [
52+ provideTippyConfig ({
53+ defaultVariation: ' tooltip' ,
54+ variations: {
55+ tooltip: tooltipVariation ,
56+ popper: popperVariation ,
57+ }
58+ })
59+ ]
6060})
61- export class AppModule {
62- }
6361```
6462
6563Add the styles you want to ` styles.scss ` :
@@ -72,10 +70,9 @@ Add the styles you want to `styles.scss`:
7270
7371You have the freedom to [ customize] ( https://atomiks.github.io/tippyjs/v6/themes/ ) it if you need to.
7472
75- Now you can use it in your templates:
73+ Import the standalone ` TippyDirective ` and use it in your templates:
7674
7775``` html
78-
7976<button tippy =" Helpful Message" >
8077 I have a tooltip
8178</button >
@@ -115,8 +112,7 @@ import { TIPPY_REF, TippyInstance } from '@ngneat/helipopper';
115112
116113@Component ()
117114class MyComponent {
118- constructor (@Inject (TIPPY_REF ) tippy : TippyInstance ) {
119- }
115+ tippy = inject (TIPPY_REF );
120116}
121117```
122118
@@ -159,24 +155,23 @@ First, define the `contextMenu` variation:
159155``` ts
160156import {
161157 popperVariation ,
162- TippyModule ,
163158 tooltipVariation ,
159+ provideTippyConfig ,
164160 withContextMenuVariation
165161} from ' @ngneat/helipopper' ;
166162
167- @ NgModule ( {
168- imports : [
169- TippyModule . forRoot ({
163+ bootstrapApplication ( AppComponent , {
164+ providers : [
165+ provideTippyConfig ({
170166 defaultVariation: ' tooltip' ,
171167 variations: {
172168 tooltip: tooltipVariation ,
173169 popper: popperVariation ,
174170 contextMenu: withContextMenuVariation (popperVariation ),
175171 }
176172 })
177- ],
173+ ]
178174})
179- export class AppModule {}
180175```
181176
182177Now you can use it in your template:
@@ -274,10 +269,7 @@ import { TippyService, TippyInstance } from '@ngneat/helipopper';
274269
275270class Component {
276271 @ViewChild (' inputName' ) inputName: ElementRef ;
277- private tippy: TippyInstance ;
278-
279- constructor (private tippy : TippyService ) {
280- }
272+ private tippy = inject (TippyService );
281273
282274 open() {
283275 if (! this .tippy ) {
@@ -291,33 +283,4 @@ class Component {
291283 this .tippy ?.destroy ();
292284 }
293285}
294- ```
295-
296- ## Contributors ✨
297-
298- Thanks goes to these wonderful people ([ emoji key] ( https://allcontributors.org/docs/en/emoji-key ) ):
299-
300- <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
301- <!-- prettier-ignore-start -->
302- <!-- markdownlint-disable -->
303- <table >
304- <tr >
305- <td align="center"><a href="https://www.netbasal.com/"><img src="https://avatars1.githubusercontent.com/u/6745730?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Netanel Basal</b></sub></a><br /><a href="https://github.com/@ngneat/helipopper/commits?author=NetanelBasal" title="Code">💻</a> <a href="https://github.com/@ngneat/helipopper/commits?author=NetanelBasal" title="Documentation">📖</a> <a href="#ideas-NetanelBasal" title="Ideas, Planning, & Feedback">🤔</a></td>
306- <td align="center"><a href="https://github.com/itayod"><img src="https://avatars2.githubusercontent.com/u/6719615?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Itay Oded</b></sub></a><br /><a href="https://github.com/@ngneat/helipopper/commits?author=itayod" title="Code">💻</a></td>
307- <td align="center"><a href="https://gerome-dev.netlify.com/"><img src="https://avatars0.githubusercontent.com/u/32737308?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gérôme Grignon</b></sub></a><br /><a href="https://github.com/@ngneat/helipopper/commits?author=geromegrignon" title="Code">💻</a></td>
308- <td align="center"><a href="https://medium.com/@overthesanity"><img src="https://avatars1.githubusercontent.com/u/7337691?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Artur Androsovych</b></sub></a><br /><a href="https://github.com/@ngneat/helipopper/commits?author=arturovt" title="Code">💻</a> <a href="https://github.com/@ngneat/helipopper/commits?author=arturovt" title="Tests">⚠️</a></td>
309- <td align="center"><a href="https://github.com/shaharkazaz"><img src="https://avatars2.githubusercontent.com/u/17194830?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Shahar Kazaz</b></sub></a><br /><a href="https://github.com/@ngneat/helipopper/commits?author=shaharkazaz" title="Code">💻</a> <a href="https://github.com/@ngneat/helipopper/commits?author=shaharkazaz" title="Documentation">📖</a></td>
310- <td align="center"><a href="https://houseofangular.io/team/"><img src="https://avatars.githubusercontent.com/u/55434796?v=4?s=100" width="100px;" alt=""/><br /><sub><b>stefanoww</b></sub></a><br /><a href="https://github.com/@ngneat/helipopper/commits?author=stefanoww" title="Code">💻</a></td>
311- <td align="center"><a href="https://github.com/rhutchison"><img src="https://avatars.githubusercontent.com/u/1460261?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ryan Hutchison</b></sub></a><br /><a href="https://github.com/@ngneat/helipopper/commits?author=rhutchison" title="Code">💻</a> <a href="https://github.com/@ngneat/helipopper/commits?author=rhutchison" title="Documentation">📖</a> <a href="#ideas-rhutchison" title="Ideas, Planning, & Feedback">🤔</a></td>
312- </tr >
313- </table >
314-
315- <!-- markdownlint-restore -->
316- <!-- prettier-ignore-end -->
317-
318- <!-- ALL-CONTRIBUTORS-LIST:END -->
319-
320- This project follows the [ all-contributors] ( https://github.com/all-contributors/all-contributors ) specification.
321- Contributions of any kind welcome!
322- Icon made by <a href =" https://www.flaticon.com/authors/freepik " title =" freepik " >Airport</a >
323- from <a href =" https://www.flaticon.com/ " title =" Flaticon " > www.flaticon.com </a >
286+ ```
0 commit comments