#auto-provided service for components

5 messages · Page 1 of 1 (latest)

sand stump
#

Is there a way to automatically (explicitly) provide a service in any component where it is injected?

Motivation: To remove the need to add it to the providers array in every component where I use it.

Similar to providedIn: "root" I would love to have providedIn: "component". 😅

toxic palm
#

Old versions of angular you could pass the module as a value

#

But its is deprecated now

toxic palm
#

But nope , is not possible

sand stump