`Symbol.iterator in FieldTree` is always false
- Dominant language
- TypeScript
- Stars
- 101k
- Forks
- 27.5k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 288
Description
### Which @angular/* package(s) are the source of the bug?
forms
### Is this a regression?
No
### Description
I want to traverse a `FieldTree`. A typesafe check for iterability requires checking for presence of `Symbol.iterator` field:
```ts
if (Symbol.iterator in fieldTree && typeof fieldTree[Symbol.iterator] === 'function') {
for (const [k, v] of fieldTree) {
// ...
}
}
```
However the field proxy doesn't implement `has` handler, therefore `Symbol.iterator` is reported as missing, even though it's returned by `get` handler:
https://github.com/angular/angular/blob/46d2cb7ff049dc4549080f64dceb1541b3a87cee/packages/forms/signals/src/field/proxy.ts#L67
### Please provide a link to a minimal reproduction of the bug
_No response_
### Please provide the exception or error you saw
```true
```
### Please provide the environment you discovered this bug in (run `ng version`)
```true
"@angular/forms": "^22.1.0",
```
### Anything else?
_No response_
Contributor guide
Research direction
Start in packages/forms/signals/src/field/proxy.ts at the linked proxy handler and inspect how FieldTree responds to property-presence checks versus property access. Verify that the provided TypeScript example recognizes Symbol.iterator and can traverse the FieldTree, while preserving the existing iterator behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100