search

Home  >  Q&A  >  body text

angular.js - ng-options 瞎排序的问题

Object {0: 0, 1: 2, 2: 4, 3: 6, 4: 8, 5: 11, 6: 13, 7: 15, 8: 17, 9: 19, 10: 22, 11: 24, 12: 26, 13: 28, 14: 30, 15: 33, 16: 35, 17: 37, 18: 39, 19: 41, 20: 44, 21: 46, 22: 48, 23: 50, 24: 52, 25: 55, 26: 57}

结果
遍历的option 的 value 却是

1
10
100
101
...
11
110

我没设置排序哇。。

黄舟黄舟2739 days ago793

reply all(2)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-15 16:51:44

    Convert your object into an array, http://jsfiddle.net/gzozycj8/2/

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-15 16:51:44

    Object has no order. Only arrays have order.

    reply
    0
  • Cancelreply