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.

ngRepeat fails with sparse Arrays #10544

@morrica

Description

@morrica

ngRepeat iterates over the spaces in a sparse array. If the array is missing one element this leads to an extra element being created by ngRepeat. If the array has more than one element missing the ngRepeat fails because it sees the missing elements as duplicates.

See Plunk: http://plnkr.co/edit/uvzROas6NHVzOzmfSoJi?p=preview

This is in contrast to the behavior of for(x in array) which only iterates over the elements that are actually present in the array.

Tested with angularjs 1.3.8.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions