I have a javascript array like the following:
var array = [
2005 = [
Jan = [0,1,2,3,5...],
Feb = [0,1,2,3,5...],
...more
],
2006 = [
Jan = [0,1,2,3,5...],
Feb = [0,1,2,3,5...],
...more
],
2007 = [
Jan = [0,1,2,3,5...],
Feb = [0,1,2,3,5...],
...more
]
]
$scope.cal = array;
I am trying to build a calendar with ng-repeat
<div ng-repeat = "year in cal">
{{year}}
</div>
There is nothing output and I got an error
Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys.
Repeater: year in cal, Duplicate key: undefined:undefined, Duplicate value: undefined
I am not sure what I did wrong and my brain is fried. Please help me out on this one. Thanks!
<div ng-repeat = "year in cal track by $index">