I have a code something like this with ng-repeat = \"(key,value) in data\". In Controller:
$scope.Dates = {\"Today\":\"30\",
\"This Wee
Object.keys doesn't reserve the order - FYI https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
// array like object with random key ordering
var an_obj = { 100: 'a', 2: 'b', 7: 'c' };
console.log(Object.keys(an_obj)); // console: ['2', '7', '100']
I convert it into an array of object
$scope.Dates = [
{ id: "Today", value:"30" },
{ id: "This Week", value:"42" },
{ id: "This Month", value: "Oct" },
{ id: "This Quarter", value : "Bad" },
{ id: "This Year", value : 2013 }
];
- {{date.id}} -> {{date.value}}
http://jsfiddle.net/2hqew68k/1/