What is a best way to sh…

less than 1 minute read

What is a best way to share angular service ? export in index.ts or use as provider in shared module?


Exporting it in the lib’s index.ts makes that you can import it in other places.

You can either provide them using { providedIn: root } or as you said in a shared module. I tend to use the latter for most stuff