簡體   English   中英

使用angular.js在表中添加序列號

[英]Add serial number in the table using angular.js

我有一個包含數據庫值的表,但在這里我需要使用angular.js.i在此表中添加序列號( ie-1,2,3,4..... ),並在下面解釋我的代碼。

course.html:

<div class="portlet portlet-blue" style="margin-bottom:12px;">
<div class="portlet-body">
<div class="table-responsive dashboard-demo-table">
<table class="table table-bordered table-striped table-hover" id="dataTable">
<colgroup>
<col class="col-md-1 col-sm-1">
<col class="col-md-2 col-sm-2">
<col class="col-md-2 col-sm-2">
<col class="col-md-2 col-sm-2">
<col class="col-md-2 col-sm-2">
<col class="col-md-2 col-sm-2">
<col class="col-md-1 col-sm-1">
</colgroup>
<thead>
<tr>
<th>Sl. No</th>
<th>Cource Name</th>
<th>Short Name</th>
<th>No of Semester</th>
<th>Edit</th>
</tr>
</thead>
<tbody id="detailsstockid">
<tr ng-repeat="course in courseData">
<td>{{ }}</td>
<td>{{course.course_name}}</td>
<td>{{course.short_name}}</td>
<td >{{course.semester}}</td>
<td>
<a  href='/course?e_i={{course.course_id}}'  >
<input type='button' class='btn btn-xs btn-green'  value='Edit'   >  
</a>
</td>
</tr>   
</tbody>
</table>
</div>
</div>

在序列號列中,我將按順序添加數字,這將增加每次添加數據庫值。請幫助我。

$ index將為您提供當前表中項目的索引。 但這與您的數據庫無關,只與當前表行#相關聯

<td>{{$index }}</td>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM