[Angular 19] injectStore() runs before input signals are set.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.7k
- Forks
- 682
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 7
Description
Describe the bug
injectStore() runs before input signals are set which makes it throws an error at runtime if the form is provided as an input signal.
main.ts:8 ERROR RuntimeError: NG0950: Input is required but no value is available yet
Your minimal, reproducible example
https://codesandbox.io/p/devbox/q9w9mv
Steps to reproduce
Open the shared link and see the error in the web dev tools.
The error is caused by the following code:
isValid = injectStore(
this.form(),
(state) => state.fieldMeta[this.name()].errors.length === 0
);
In the component: FirstNameComponent
Expected behavior
The injectStore should call the business logic after input signals are set like Angular Query does.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: MacOS
- Browser: Safari
TanStack Form adapter
None
TanStack Form version
@tanstack/angular-form v1.3.0
TypeScript version
v5.8.3
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the linked CodeSandbox and reproduce the error reported at main.ts:8, then inspect FirstNameComponent and the injectStore call using the form and name input signals. Done means the Angular example no longer throws NG0950 and injectStore runs its business logic after the input signals are set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100