Angularjs 无法在智能表tbody中获取当前页
我的智能桌看起来像:Angularjs 无法在智能表tbody中获取当前页,angularjs,smart-table,Angularjs,Smart Table,我的智能桌看起来像: <table st-safe-src="input.inputBuckets" st-table="inputBuckets" class="table"> <thead> <tr> <th>Timestamp</th> <th ng-repeat="r
<table st-safe-src="input.inputBuckets" st-table="inputBuckets"
class="table">
<thead>
<tr>
<th>Timestamp</th>
<th ng-repeat="row in input.inputSeriesPrinted">{{row}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in inputBuckets track by $index">
<td>{{row.key | date:'yyyy-MM-dd HH:mm:ss'}}</td>
//current page is undefined
<td ng-repeat="item in input.inputData" >{{item[$parent.$index] + (currentPage-1)*10]}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="10" class="text-center">
<div st-pagination="" st-items-by-page="10" st-displayed-pages="7"></div>
</td>
</tr>
</tfoot>
</table>
所以,因为我在ng repeat中使用了ng repeat并使用父索引,所以我需要一个用于新项目集的当前页面。如果没有该项,则只有[$parent.$index]项会为每个页面显示相同的数据。当前页面未定义。有什么建议可以让我的身体内的当前页面
编辑:这里是我的例子,关于打印索引out ng repeat和inner ng repeat的问题。您的问题不完整,因为您没有向我们展示您的控制器端。因此,根据我的理解,答案如下 当前页面未定义 您尚未在控制器中定义它,或者您的数据值未定义 您可以定义索引的名称并使用它,类似这样 var myApp=angular.module'myApp',[]; 函数MyCtrl$scope{ $scope.line=[{ 正文:“第1页” }, { 正文:“第2页” }]; $scope.someData=[{ 文本:“一些数据1” }, { 文本:“一些数据2” }]; } {{line.text}}页面索引:{{pageIndex} {{someData[pageIndex]} 父索引:{{pageIndex}} childIndex:{{dataIndex}}
这不是我需要的。可能是因为智能表分页,在第二页,我从您的案例中的父pageIndex获得了相同的索引。所以在第1页,我有从0到9的索引,在第二页、第三页等等都有相同的索引。@MatijaŽupančIć我了解其中的一部分。你能做个提琴什么的吗?MatijaŽupančIć看起来像是根据smarttables的文档,当指令控制分页时,你需要使用一个ng repeat。