Use the providedIn
attribute of @Injectable() decorator to make your service tree-shakable [Angular 6+].
We can specify the module for which the service needs to be injected for. Handy to create singletons.
Use the providedIn
attribute of @Injectable() decorator to make your service tree-shakable [Angular 6+].
We can specify the module for which the service needs to be injected for. Handy to create singletons.