arturovt fee6dbf526 fix(core): throw coded error when @for collection is not iterable
Consider the following example:

```ts
@Component({
  template: '@for (item of items; track item) {{{ item }}}',
})
class App {
  items = {0: 'a', 1: 'b'};
}
```

Prior to this commit, `reconcile()` treated every non-nullish value that is
not an array as an iterable and called `Symbol.iterator` on it without a
check. A plain object therefore failed with a raw `TypeError`:

```
TypeError: t[Symbol.iterator] is not a function
```

That error carries no code, does not mention `@for`, and does not say which
template produced it. In a production build the stack is minified, so error
reporting shows nothing actionable. The same value through `*ngFor` reports
NG02200, which names the problem and suggests the keyvalue pipe, so `@for`
was harder to debug than the API it replaces.

With this commit the same value throws NG0957. Only the message text is
behind `ngDevMode`; the check itself is not, because production is where the
raw error is unreadable today. The array fast path is untouched, and `null`
and `undefined` keep rendering nothing.

The code is negative, which is how this package marks codes that have a
guide on angular.dev, so the fix ships with one.
2026-11-19 15:39:55 -08:00
…
2026-09-09 21:48:04 +02:00
2026-11-18 10:27:47 -08:00
2026-11-17 10:14:02 -08:00
2025-11-06 10:03:05 -08:00
2026-01-07 12:28:34 -05:00
2026-04-27 17:08:02 -07:00
2026-10-28 11:40:51 -07:00

Angular - The modern web developer's platform

angular-logo
Angular is a development platform for building mobile and desktop web applications
using TypeScript/JavaScript and other languages.

angular.dev

Contributing Guidelines · Submit an Issue · Blog

Angular on npm


Documentation

Get started with Angular, learn the fundamentals and explore advanced topics on our documentation website.

Advanced

Local Development

To contribute to the Angular Docs, check out the Angular.dev README

Development Setup

Prerequisites

Setting Up a Project

Install the Angular CLI globally:

npm install -g @angular/cli

Create a workspace:

ng new [PROJECT NAME]

Run the application:

cd [PROJECT NAME]
ng serve

Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.

Quickstart

Get started in 5 minutes.

Ecosystem

angular ecosystem logos

Changelog

Learn about the latest improvements.

Upgrading

Check out our upgrade guide to find out the best way to upgrade your project.

Contributing

Contributing Guidelines

Read through our contributing guidelines to learn about our submission process, coding rules, and more.

Want to Help?

Want to report a bug, contribute some code, or improve the documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.

Code of Conduct

Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.

Community

Join the conversation and help the community.

Love Angular badge

Love Angular? Give our repo a star ⭐ ⬆️.

Languages
TypeScript 73.1%
JavaScript 15.7%
Rust 6.6%
HTML 1.6%
Starlark 1.6%
Other 1.4%