错误:[ngRepeat:dupes]看似有效的对象

时间:2015-11-02 17:51:41

标签: angularjs

我收到重复的密钥错误

这个对象给了我错误:

$scope.workoutData = {
    "2015-02-01":[["16:22:45","2","7","270","1"]],
    "2015-06-11":[["18:34:10","2","8","225","1"]],
    "2015-06-22":[["18:30:45","1","8","185","1"]]
};

但是这个没有:

$scope.workoutData = {
    "2015-02-01":[["16:22:45","2","7","270","1"]],
    "2015-06-11":[["18:34:10","2","8","225","1"]]
};

这是我的HTML

       <div id="calendar" ng-controller="calendarCtrl">
            <div id="owl-demo" class="owl-carousel owl-theme">
                <div class="item" ng-repeat="(date, figures) in workoutData track by $index">
                    <div class="scollHeader">
                        {{date}}
                    </div>
                    <div class="scrollBody">
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>Time</th>
                                    <th>Exercise</th>
                                    <th>Reps</th>
                                    <th>Weight</th>
                                    <th>Location</th>

                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-repeat="set in figures">
                                    <td ng-repeat="dataPoint in set">{{dataPoint}}</td>

                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

使用较大的对象时,<div class="item" ng-repeat="(date, figures) in workoutData track by $index">会正确重复3次,但数据不会添加到第3个<div>

"2015-06-22":[["18:30:45","1","8","185","1"]]给我这个错误的是什么?

0 个答案:

没有答案