Angular & Signals (283 Qs)•Part 9: NgModules, Providers, NgZone & Injector Hierarchies (213 - 255)
What is the recommendation for provider scope?
You should always provide your service in the root injector unless there is a case where you want the service to be available only if you import a particular @NgModule.
Practical Code Example
typescript
// Provider Scope Recommendation:
// Use { providedIn: 'root' } for singleton services across the entire application:
@Injectable({ providedIn: 'root' })
export class AppService {}