We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Where to import which service
This service will be injected only once, could be into the app.module.ts Example: AppThemeService, SessionService, DarkModeService, ...
app.module.ts
AppThemeService
SessionService
DarkModeService
...
@Injectable({ providedIn: 'root', }) export class sessionService {/** ... **/}
src └── app └── core └── services ├── [name].service.ts ├── session.service.ts // example └── dal.service.ts // example
Meant to be imported multiple time across the project Example: loaderService, qrCodeService, ...
loaderService
qrCodeService
@Injectable() export class loaderService {/** ... **/}
src └── app └── shared └── services └── loader.service.ts // <-- Here
This service will be injected into the component directly
src └── app └── pages └── [page] ├── [page].component.html ├── [page].component.ts ├── [page].module.ts └── [page].service.ts
// [page].module.ts @NgModule({ declarations: [], imports: [], providers: [pageService], // <-- Here })
or
// [page].component.ts @Component({ standalone: true, declarations: [], imports: [], providers: [pageService], // <-- Here })