Angular js ui树抛出异常 - TypeError:无法读取未定义的属性'0'

时间:2016-10-15 19:11:17

标签: javascript jquery angularjs angular

当我的页面加载树时,在控制台中获取异常。 此外还存在严重的性能问题,使得加载树至少需要30秒。

Html页面

<div class="col-md-12">
    <script type="text/ng-template" id="items_renderer.html">
        <div ui-tree-handle>
            <span ng-bind-html="item.name| highlight:pattern | trust"></span>
        </div>
        <ol ui-tree-nodes ng-model="item.items">
            <li ng-repeat="item in item.childCategoryList" ui-tree-node
                ng-include="'items_renderer.html'"
                ng-click="pc.att(item.categoryId)"
                ng-hide="!treeFilter(item,pattern,supportedFields) && !dim"
                ng-class="{'filtered-out':!pc.treeFilter(item,pattern,supportedFields) && dim}">
            </li>
        </ol>
    </script>
    <div ui-tree>
        <ol ui-tree-nodes ng-model="item.items">
            <li ng-repeat="item in pc.catList" ui-tree-node
                ng-include="'items_renderer.html'"
                ng-hide="!treeFilter(item,pattern,supportedFields) && !dim"
                ng-class="{'filtered-out':!pc.treeFilter(item, pattern,supportedFields) && dim}">
            </li>
        </ol>
    </div>
</div>

controller.js

vm.catAttList = response.data.data.catAttList;

控制台

angular.js:12783 TypeError: Cannot read property '0' of undefined
    at Scope.e.init (localhost:8080/web/app/bower_components/angular-ui-tree-master/dist/angular-ui-tree.min.js:6:1243)

0 个答案:

没有答案