I have a code something like this with ng-repeat = "(key,value) in data".
In Controller:
$scope.Dates = {"Today":"30",
"This Week":"42",
"This Month": "Oct",
"This Quarter" : "Bad",
"This Year" : 2013
}
and ng-repeat directive as
<div ng-repeat="(key,value) in Dates">
{{key}} ==> {{value}}
</div>
The output comes in sorted order as
This Month ==> Oct
This Quarter ==> Bad
This Week ==> 42
This Year ==> 2013
Today ==> 30
How to get rid of this sorting(strange) as I want keys to be used in code.. I checked google group but there was a fiddle for using two arrays of which one was storing the key values. http://jsfiddle.net/Saulzar/puhML/3/b . Don't want to go with this approach.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…