-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngOptions mutilating ordering of values in array #9465
Comments
Hi, |
@tbosch It's not fixed. Do refer to this updated fiddle, and note the position of the string "011" in the select dropdown. Shouldn't it be at the bottom rather than the third position? |
Ok, now I know the problem: To fix your problem, don't use So but yes, it is weird that using |
Note that this has been there since the beginning of |
Thanks tbosch. I did get the logic behind the sorting, and it is rather inevitable if angular is naïve enough to treat the array indices as strings. But, in the absence of properly specifying a And no, the |
This is fixed by #10639 - see http://jsfiddle.net/8gLagt22/ - ngOptions now doesn't attempt to sort the keys of an object at all. |
This is fixed in 1.4. If you are still on 1.3.x, you are encouraged to upgrade. Compared to 1.2 -> 1.3 the upgrade is quite painless.:) |
If I have an array with 11 or more items, and I write this piece of code:
Then the order in the options is this:
relevant jsfiddle: http://jsfiddle.net/97h62/44/
The text was updated successfully, but these errors were encountered: