angularjs的ng-repeat循环列表中序号怎么写
2个回答
2014-12-16 · 知道合伙人数码行家
huanglenzhi
知道合伙人数码行家
向TA提问 私信TA
知道合伙人数码行家
采纳数:117538
获赞数:517190
长期从事计算机组装,维护,网络组建及管理。对计算机硬件、操作系统安装、典型网络设备具有详细认知。
向TA提问 私信TA
关注
展开全部
直接上代码,一看就懂了:
<table class="table table-bordered mt20 table-td-center">
<thead>
<tr>
<th>序号</th>
<th>昵称</th>
<th>性别</th>
<th>年龄</th>
<th>星座</th>
<th>关注时间</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="fans in vm.data.users">
<td ng-bind="$index+1">1</td>
<td ng-bind="fans.nickname">郑州网建</td>
<td ng-bind="fans.gender=='m'?'男':'女'">男</td>
<td ng-bind="vm.getDate(fans.birthday)">32</td>
<td>白羊座</td>
<td>2014-09-02 00:00 </td>
</tr>
</tbody>
</table>
$index是从0开始计数的,所以,这里,我们+1
<table class="table table-bordered mt20 table-td-center">
<thead>
<tr>
<th>序号</th>
<th>昵称</th>
<th>性别</th>
<th>年龄</th>
<th>星座</th>
<th>关注时间</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="fans in vm.data.users">
<td ng-bind="$index+1">1</td>
<td ng-bind="fans.nickname">郑州网建</td>
<td ng-bind="fans.gender=='m'?'男':'女'">男</td>
<td ng-bind="vm.getDate(fans.birthday)">32</td>
<td>白羊座</td>
<td>2014-09-02 00:00 </td>
</tr>
</tbody>
</table>
$index是从0开始计数的,所以,这里,我们+1
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
引用huanglenzhi的回答:
直接上代码,一看就懂了:
<table class="table table-bordered mt20 table-td-center">
<thead>
<tr>
<th>序号</th>
<th>昵称</th>
<th>性别</th>
<th>年龄</th>
<th>星座</th>
<th>关注时间</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="fans in vm.data.users">
<td ng-bind="$index+1">1</td>
<td ng-bind="fans.nickname">郑州网建</td>
<td ng-bind="fans.gender=='m'?'男':'女'">男</td>
<td ng-bind="vm.getDate(fans.birthday)">32</td>
<td>白羊座</td>
<td>2014-09-02 00:00 </td>
</tr>
</tbody>
</table>
$index是从0开始计数的,所以,这里,我们+1
直接上代码,一看就懂了:
<table class="table table-bordered mt20 table-td-center">
<thead>
<tr>
<th>序号</th>
<th>昵称</th>
<th>性别</th>
<th>年龄</th>
<th>星座</th>
<th>关注时间</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="fans in vm.data.users">
<td ng-bind="$index+1">1</td>
<td ng-bind="fans.nickname">郑州网建</td>
<td ng-bind="fans.gender=='m'?'男':'女'">男</td>
<td ng-bind="vm.getDate(fans.birthday)">32</td>
<td>白羊座</td>
<td>2014-09-02 00:00 </td>
</tr>
</tbody>
</table>
$index是从0开始计数的,所以,这里,我们+1
展开全部
应该要加上括号吧,像这样:
<div class="helpRankLi" ng-repeat="ar in assistedList">
<div><span>{{$index+1}}</span></div>
<div><img src="{{ar.headurl}}"/></div>
<div><span>{{ar.name}}</span></div>
</div>
<div class="helpRankLi" ng-repeat="ar in assistedList">
<div><span>{{$index+1}}</span></div>
<div><img src="{{ar.headurl}}"/></div>
<div><span>{{ar.name}}</span></div>
</div>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询