Skip to content

docs: use the @service decorator in the first-app and signals tutorials#69381

Merged
kirjs merged 1 commit into
angular:mainfrom
erkamyaman:docs-tutorials-service-decorator
Jun 18, 2026
Merged

docs: use the @service decorator in the first-app and signals tutorials#69381
kirjs merged 1 commit into
angular:mainfrom
erkamyaman:docs-tutorials-service-decorator

Conversation

@erkamyaman

Copy link
Copy Markdown
Contributor

Update the services in the first-app and signals tutorials to use the
@Service() decorator instead of @Injectable({providedIn: 'root'}).
This affects HousingService (first-app steps 10-14) and CartStore
(signals step 7).

PR Checklist

Please check that your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other

What is the current behavior?

The first-app tutorial (HousingService, steps 10-14) and the signals
tutorial (CartStore, step 7) still introduce services with
@Injectable({providedIn: 'root'}). The essentials guide, the in-depth
dependency injection guides, and the learn-angular DI tutorial have
already adopted the newer @Service decorator, leaving these tutorials
out of step with the rest of the docs.

What is the new behavior?

Both tutorials use @Service(). Since @Service() is an ergonomic
shorthand for @Injectable({providedIn: 'root'}) (it defaults to
autoProvided: true), the examples behave identically while teaching the
recommended modern API. The signals step 7 README snippet is updated to
match.

Does this PR introduce a breaking change?

  • Yes
  • No

Update the services in the first-app and signals tutorials to use the
`@Service()` decorator instead of `@Injectable({providedIn: 'root'})`.
This affects `HousingService` (first-app steps 10-14) and `CartStore`
(signals step 7).
@pullapprove pullapprove Bot requested a review from alan-agius4 June 16, 2026 19:42
@angular-robot angular-robot Bot added the area: docs Related to the documentation label Jun 16, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jun 16, 2026
@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jun 17, 2026
@JeanMeche JeanMeche removed the request for review from alan-agius4 June 17, 2026 22:35
@kirjs kirjs merged commit e7a4e25 into angular:main Jun 18, 2026
25 checks passed
@kirjs

kirjs commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: docs Related to the documentation target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants