Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs ng表格不分页表格内容,只显示页码_Angularjs_Pagination_Ngtable - Fatal编程技术网

Angularjs ng表格不分页表格内容,只显示页码

Angularjs ng表格不分页表格内容,只显示页码,angularjs,pagination,ngtable,Angularjs,Pagination,Ngtable,我正在尝试使用分页表分页。它在一页中显示所有数据,而不是分页。它不会给出任何错误,也不会显示页码,但内容不会分页 <body ng-app="AngularApp"> <table class="table table-bordered table-striped table-hover" id="log_table" ng-controller="ControllerCtrl" ng-table="tableParams"> <tr ng-repeat=

我正在尝试使用分页表分页。它在一页中显示所有数据,而不是分页。它不会给出任何错误,也不会显示页码,但内容不会分页

<body ng-app="AngularApp">
<table class="table table-bordered table-striped table-hover" id="log_table" ng-controller="ControllerCtrl"  ng-table="tableParams">
    <tr ng-repeat="logDetail in data">
      <td>{{logDetail._source.log_datetime[0]}}</td>
      <td>{{logDetail._source.event_src_correlation[0]}}</td>
      <td>{{logDetail._source.content_subType[0]}}</td>
    </tr>
</table>
</body>

angular.module('AngularApp',['ngTable'])
  .controller('ControllerCtrl', function ($scope,$q, ngTableParams) {
    $scope.data=[{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-22T17:17:56.689"],"event_src_correlation":[1]},"sort":[1]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-22T19:48:20.459"],"event_src_correlation":[1]},"sort":[2]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-22T19:49:00.981"],"event_src_correlation":[1]},"sort":[3]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-24T20:33:51.762"],"event_src_correlation":[1]},"sort":[4]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-24T20:33:51.763"],"event_src_correlation":[1]},"sort":[5]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-24T20:33:51.768"],"event_src_correlation":[1]},"sort":[6]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-24T20:33:51.770"],"event_src_correlation":[1]},"sort":[7]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-24T20:33:51.784"],"event_src_correlation":[1]},"sort":[8]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-24T20:33:59.943"],"event_src_correlation":[1]},"sort":[9]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-24T20:34:00.360"],"event_src_correlation":[1]},"sort":[10]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:18:08.149"],"event_src_correlation":[1]},"sort":[11]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:18:08.150"],"event_src_correlation":[1]},"sort":[12]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:18:08.151"],"event_src_correlation":[1]},"sort":[13]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:18:08.152"],"event_src_correlation":[1]},"sort":[14]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:18:08.165"],"event_src_correlation":[1]},"sort":[15]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:18:36.586"],"event_src_correlation":[1]},"sort":[16]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:18:36.965"],"event_src_correlation":[1]},"sort":[17]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:19:05.467"],"event_src_correlation":[1]},"sort":[18]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:19:05.468"],"event_src_correlation":[1]},"sort":[19]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:19:05.468"],"event_src_correlation":[1]},"sort":[20]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:19:05.469"],"event_src_correlation":[1]},"sort":[21]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:19:05.476"],"event_src_correlation":[1]},"sort":[22]},{"_source":{"content_subType":["tomcatLog"],"log_datetime":["2014-02-26T13:19:35.917"],"event_src_correlation":[1]},"sort":[23]}];
    $scope.tableParams = new ngTableParams({
            page: 1,            // show first page
            count: 10           // count per page
        }, {
            total: $scope.data.length, // length of data
            getData: function($defer, params) {
                $defer.resolve($scope.data.slice((params.page() - 1) * params.count(), params.page() * params.count()));
            }
        });      
    });

{{logDetail.\u source.log\u datetime[0]}
{{logDetail.\u source.event\u src\u correlation[0]}
{{logDetail.\u source.content\u子类型[0]}
angular.module('AngularApp',['ngTable']))
.controller('ControllerCtrl',函数($scope,$q,ngTableParams){
$scope.data=[{u-source]:{“content-u-subType”:[“tomcatLog”],“log-u-datetime”:[“2014-02-22T17:17:56.689”],“event-u-src-u-correlation:[1]},“sort:[1]},{u-source:{“content-u-subType”:[“tomcatLog”],“log-datetime:[“2014-02-22T19:48:20.459”,“event-u-src-u-u-correlation:[1],“sort”;“sort:[2]},{source datelog”;“content”;“datetime:”[2014-02-22-22-22-14 14-14-14-22-14-14-14-14-14-14-14-14-14-20-14 14-02-02-02-22-22-14-14-14-14-14-14-14-22-14-14-14-14-14-14-14-14-00.00.00.00.00.981“,,“事件和事件与src-src-src-src-src-src.相关的相关的相关关系:::[1,[1,[1],,,,,,,“事件与[1]排序:,,,,,,,,“事件与事件与事件与src-事件与src与src.相关的相关的相关的src.相关的相关的src.相关的相关的相关的相关的关系,排序::::,,,,,,,,,,,,,,“事件与事件与相关的相关的相关的相关的相关的"内容子类型:[“tomcatLog”],“log_datetime”:[“2014-02-24T20:33:51.768”],“事件src_相关性”:[1],“排序”:[6],{“源”:{“内容子类型”:[“tomcatLog”],“log_datetime”:[“2014-02-24T20:33:51.770”],“事件src_相关性”:[1],“排序”:[7],{“源”:{“内容子类型”,“tomcatLog事件相关:[1],“排序”:[8],{“内容子类型”:[“tomcatLog”],“日志日期时间”:[“2014-02-24T20:33:59.943],“事件相关”:[1],“排序”:[9],{“内容子类型”:[“tomcatLog”],“日志日期时间”:“2014-02-24T20:34:00.360”,“事件相关”:[1],“排序”:[9],{“内容子类型”:[“tomcatLog子类型”:[“2014-02-24T20:34:00.360],“事件相关”log_datetime:[“2014-02-26T13:18:08.149”],“事件相关”:[1],“排序”:[11],{“源”:{“内容子类型”:[“tomcatLog”],“log_datetime:[“2014-02-26T13:18:08.150”,“事件相关”:[1],“排序”:[12],{“源”:{“内容子类型”:“tomcatLog”,“log datetime:[“2014-02-26T13:18:18”,“事件相关”:[1],[12],[SRCU_来源:{“内容子类型”:[“tomcatLog”],“日志日期时间”:[“2014-02-26T13:18:08.152”],“事件src相关性”:[1],“排序”:[14],{“内容子类型”:[“tomcatLog”],“日志日期时间”:[“2014-02-26T13:18:08.165”,“事件src相关性[1],“排序”:[15],{“内容子类型”:[“内容子类型”:“tomcatLog”,“日志日期时间”:[“2014-02-26T13:18:08.165”,“事件src相关性[1],“排序”:[15],{“内容子类型”,“tomcatLog时间”事件相关:[1],“排序”:[16],{“内容子类型”:[“tomcatLog”],“日志日期时间”:[“2014-02-26T13:18:36.965],“事件相关”:[1],“排序”:[17],{“内容子类型”:[“tomcatLog”],“日志日期时间”:“2014-02-26T13:19:05.467”,“事件相关”:[1],[17],{“内容子类型”:[“tomcatLog子类型”:[2014-02-02-02-26T13:19:19:19:19.468“,“事件”事件的src-src的相关[1],“排序:[1],,”排序:[19],,,,,,,,,,[1],,,“事件的src-src的相关[1],,“事件的事件的src-src-src的相关[1]相关[1],,,,“排序:,,”排序:,[19],[19],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,“事件的事件的事件的事件的事件的事件的事件的src的src的src的src的src的src的src的src的src的相关相关[1]的相关[1]的相关[1]的相关[1"_来源:{“内容子类型”:[“tomcatLog”],“日志日期时间”:[“2014-02-26T13:19:05.476”],“事件src相关性”:[1],“排序”:[22],{“内容子类型”:[“tomcatLog”],“日志日期时间”:[“2014-02-26T13:19:35.917”,“事件src相关性”:[1],“排序”:[23];
$scope.tableParams=新的ngTableParams({
第1页,//显示第一页
计数:10//每页计数
}, {
总计:$scope.data.length,//数据长度
getData:函数($defer,params){
$defer.resolve($scope.data.slice((params.page()-1)*params.count(),params.page()*params.count());
}
});      
});

附加的plunker链接包含它的代码:

您刚刚错过了$in ng中继器应该是$data中的
logdetail
instad of
logdetail in data


{{logDetail.\u source.log\u datetime[0]}
{{logDetail.\u source.event\u src\u correlation[0]}
{{logDetail.\u source.content\u子类型[0]}

您刚刚错过了$in ng中继器应该是$data中的
logdetail
instad of
logdetail in data


{{logDetail.\u source.log\u datetime[0]}
{{logDetail.\u source.event\u src\u correlation[0]}
{{logDetail.\u source.content\u子类型[0]}

Ohh..现在我知道了,ng表总是返回$data,我正在尝试我的范围变量名进行迭代。谢谢:)Ohh..现在我知道了,ng表总是返回$data,我正在尝试我的范围变量名进行迭代。谢谢:)
<table class="table table-bordered table-striped table-hover" id="log_table" ng-table="tableParams">
  <tr ng-repeat="logDetail in $data">
    <td>{{logDetail._source.log_datetime[0]}}</td>
    <td>{{logDetail._source.event_src_correlation[0]}}</td>
    <td>{{logDetail._source.content_subType[0]}}</td>
  </tr>
</table>