How to use natural sorting in ng-options?

前端 未结 2 1423
时光取名叫无心
时光取名叫无心 2021-01-21 16:22

I have an object like this:

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:          


        
2条回答
  •  渐次进展
    2021-01-21 16:46

    You can try this:

    Javascript

    self.foo = []
    angular.forEach [9..364], (i, el) ->
        self.foo.push({ key: el, value: ~~(el / 0.45359237) })
    

    HTML

    
    

提交回复
热议问题