In Angular 2+, it is best to share services between modules by:
Export the service in a Core or Shared module: Build a CoreModule (for singleton services) or SharedModule (for non-singleton services) and list the service in the providers array of such a module.
Use providedIn: 'root': When the service is a singleton, use the @Injectable({ providedIn: 'root' }) decorator within the service. This provides the service application-wide without having to add it to a module's providers array.
Lazy-loaded modules: For service that is particular to a feature module, implement them directly in the feature module. But with care because they can lead to multiple instances when the module is lazy-loaded.
Example:
@Injectable({
providedIn: 'root' // Singleton service available app-wide
})
export class MyService {}