Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Spacing in ng-repeat using key, value pair #14481

@LeftPinkie

Description

@LeftPinkie

I'm using AngularJS v1.2.15, Firefox 45.

I am experiencing a bug with ng-repeat using key/value pair.

The error message returned is ngRepeat:iidexp

These will generate the error (space next to either of the parenthesis):

<div ng-repeat='( group, products) in FeaturedProducts'>
...
</div>

<div ng-repeat='(group, products ) in FeaturedProducts'>
...
</div>

<div ng-repeat='( group, products ) in FeaturedProducts'>
...
</div>

These will work (no space next to either of the parenthesis):

<div ng-repeat='(group, products) in FeaturedProducts'>
...
</div>

<div ng-repeat='(group , products) in FeaturedProducts'>
...
</div>

My object is:

FeaturedProducts => {
  "Test 1": [
    {
      "id": "1A",
      "title": "blah 1A"
    },
    {
      "id": "1B",
      "title": "blah 1B"
    }
  ],
  "Test 2": [
    {
      "id": "2A",
      "title": "blah 2A"
    }
  ]
}

It's not really a show-stopper, just an annoyance. Any idea why having a space next the parenthesis would cause the error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions