Angular 1.6升级导致:TypeError:无法读取未定义的属性“nodeName”

时间:2017-03-30 17:52:46

标签: javascript arrays ngtable angularjs-1.6

升级到Angular 1.62并且一组复杂的数组停止工作,我在页面加载的早期就出现了这个错误。我想我正在失去对$ index的追踪?

$scope.purchaseList = vm.pq.purchaseItemsList;
                            vm.tabledataNew = [];
                            for (var i = 0; i < $scope.purchaseList.length; i++) {
                                vm.tabledataNew[i] = {};
                                var datat = $scope.purchaseList[i];
                                vm.tabledataNew[i].tableParams = new NgTableParams({
                                    total: datat.mainProductAndAddons.length
                                }, {
                                    dataset: datat.mainProductAndAddons
                                });
                            }

<div class="st-table pq-items" ng-repeat="itemgroup in purchaseList track by $index" ng-show="ctrl.showNoItems == false">
                <table class="table" ng-table="ctrl.tabledataNew[$index].tableParams">
                    <tr ng-repeat="item in $data">
                        <td data-title="'Item'"sortable="'description'" class="first">{{::item.description}}</td>
                        <td data-title="'List Price'" sortable="'listPrice'">{{::item.listPrice | currency}}</td>
                        <td data-title="'Discount'" sortable="'discountAmount'">{{::item.discountAmount | currency}}</td>
                        <td data-title="'Final Price'" sortable="'finalPrice'">{{::item.finalPrice | currency}}</td>
                        <td class="last"></td>
                    </tr>
                </table>
            </div>

0 个答案:

没有答案