Skip to content

Better syntax checking of index syntax in ngFor #17358

@ghost

Description

I'm submitting a ...

[x] bug report => search github for a similar issue or PR before submitting

Current behavior
Silence

Expected behavior
Syntax error

Minimal reproduction of the problem with instructions

*ngFor="let elem of elements; let i of index"

Notice the "of index", which should be "= index".

Got no errors of any sorts, but the behavior is the same as "i = elem", leading to nasty runtime bugs.

What is the motivation / use case for changing the behavior?
To avoid spending hours on stupid bugs like that.

Please tell us about your environment:

  • Angular version: 2.0.X
    Latest officially released 4

  • Browser:
    all

  • Language:
    TypeScript 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions