【问题标题】:Angular js datatable UseAngular js数据表使用
【发布时间】:2018-09-20 11:18:15
【问题描述】:

如何将基本表转换为数据表。我的表格代码在这里。 我添加了 datatables.net 模块,但我不能使用它。

<table class="table table-striped" id="myTable">
<thead>
<tr>
  <th>Kategori ID</th>
  <th>Ürün ID</th>
  <th>Ürün Adı</th>
  <th>Ürün Hacmi</th>
  <th>Ürün Fiyatı</th>
  <th>Ürün Sayısı</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of products">
<td>{{item.productId}}</td>
<td>{{item.categoryId}}</td>
<td>{{item.productName}}</td>
<td>{{item.quantityPerUnit}}</td>
<td>{{item.unitPrice}}</td>
<td>{{item.unitsInStock}}</td>
</tr>
</tbody>

</table>

【问题讨论】:

标签: angularjs datatables


【解决方案1】:

如果你已经添加了数据表的依赖,那么只需在表标签中添加属性

<table datatable="" class="table table-striped" id="myTable">
...
</table>

如果未添加依赖项,则使用

添加它
angular.module('MyApp', ['datatables']);

更多详情请至http://l-lin.github.io/angular-datatables/archives/#!/zeroConfig

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-20
    • 2015-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多