mirror of https://github.com/ghostfolio/ghostfolio
Browse Source
Replaces `@Injectable({ providedIn: 'root' })` with `@Service()` across the
13 services that used it. `@Service()` is automatically available in the DI
system, so the two are equivalent.
Two of them used constructor injection, which `@Service()` rejects with
NG2028, so those now inject their dependencies as fields -- the pattern the
rest of the codebase already uses. LayoutService keeps its constructor body;
only the parameters moved, and field initialisers still run before it.
Services declared with a bare `@Injectable()` are left alone: they are not
auto-provided, so they would need `@Service({ autoProvided: false })`, which
is a different change from the one this issue describes.
Resolves #7669
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pull/7671/head
13 changed files with 31 additions and 56 deletions
Loading…
Reference in new issue