Angular' childNodes'未定义的错误

时间:2016-05-13 14:50:15

标签: javascript angularjs angularjs-scope angular-ui-router

我正在尝试在加载视图时查看数据表click here。目前我收到错误消息Type error : Cannot read property 'childNodes' of undefined,这是阻止我的服务数据加载。通常会导致此问题的原因以及如何解决?

<table class="sortable">
    <thead>
      <tr>
        <th>Original Balance</th>
        <th>Effective Date</th>
        <th>Amount</th>
        <th>Action</th>
        <th>New Balance</th>
      </tr>
    </thead>
    <tbody ng-repeat="user in days | filter:query | limitTo: 1">
        <tr>
          <td>{{user['orginal-balance']['30-sept-15']}}</td>
          <td>{{user['effective-date']['30-sept-15']}}</td>
          <td>{{user['amount']['30-sept-15']}}</td>
          <td>{{user['action']['30-sept-15']}}</td>
          <td>{{user['new balance']['30-sept-15']}}</td>
        </tr>
    </tbody>
 </table>

服务

var promise = monthlyService.getmonths();
promise.then(function (data){
    $scope.months = data.months;
});

控制器

.controller('policyCtrl', ['$scope', '$http', function($scope, $http) {
    $(document).ready(function(){
        $('.summary').matchHeight();
        $('.statements').responsiveTabs({
          startCollapsed: 'accordion'
        });
        $.ReStable({
          rowHeaders: false,
          maxWidth: 1024,
          keepHtml: false
        });
        $(".sortable").DataTable({
          "order": [[0, "desc"]]
        });
        if ($('.portal-body').children('.policy-block').length > 1) {
          $(".policy-block").addClass("multiple");
        }
    });
}
TypeError: Cannot read property 'childNodes' of undefined

0 个答案:

没有答案