I am facing an issue with an array that has improper key order, such as:
1: Array[1]
2: Array[2]
4: Array[3]
7: Array[14]
21: Array[1]
22: Array[1]
23: Array[1]
When I use ng-repeat
to iterate through this array, it generates empty elements for key values that are missing.
For example, it will generate elements for keys 1 and 2, but since there is no key 3, it will create an empty div in its place. This pattern continues after key 4, with three empty elements being generated. How can I resolve this issue?