Skip to content

fix(schematics): use inject in generated data, effect, and component-store templates - #5142

Merged
markostanimirovic merged 4 commits into
ngrx:mainfrom
slang123:fix/schematics-use-inject-5136
Apr 13, 2026
Merged

fix(schematics): use inject in generated data, effect, and component-store templates#5142
markostanimirovic merged 4 commits into
ngrx:mainfrom
slang123:fix/schematics-use-inject-5136

Conversation

@slang123

@slang123 slang123 commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] 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... Please describe:

What is the current behavior?

Schematic templates currently generate constructor-based DI in some outputs (data, effect, and component-store) instead of using inject(...).

Closes #5136

What is the new behavior?

Updated schematic templates to generate inject(...)-based DI:

  • data template now uses inject(EntityCollectionServiceElementsFactory) in the super(...) call.
  • effect template now uses private actions$ = inject(Actions) instead of constructor injection.
  • component-store template was updated to use inject(...)-based initialization.
  • Related snapshots were updated to reflect generated output changes.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Changes are scoped to @ngrx/schematics template output and snapshot expectations.

@netlify

netlify Bot commented Apr 7, 2026

Copy link
Copy Markdown

Deploy Preview for ngrx-io ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 3e6184d
🔍 Latest deploy log https://app.netlify.com/projects/ngrx-io/deploys/69d81c0a81b3ca00081f4aaa
😎 Deploy Preview https://deploy-preview-5142--ngrx-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@slang123
slang123 force-pushed the fix/schematics-use-inject-5136 branch from a083b1d to b56287d Compare April 7, 2026 22:00
@slang123
slang123 force-pushed the fix/schematics-use-inject-5136 branch from b56287d to 7d3679b Compare April 7, 2026 22:04

@timdeschryver timdeschryver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just one question.

@timdeschryver timdeschryver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@markostanimirovic
markostanimirovic merged commit bc253ae into ngrx:main Apr 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update templates to use inject instead of constructor

3 participants