var appMainModule = angular.module('appMain', ['darthwade.loading', 'firebase', 'ngRoute', 'smart-table'])
你可以看到我添加了智能表的依赖。
然后这是我的HTML
<div class="card">
<div class="content">
<table st-table="rowCollection" class="table">
<thead>
<tr>
<th st-sort="firstName">first name</th>
<th st-sort="lastName">last name</th>
<th st-sort="birthDate">birth date</th>
<th st-sort="balance">balance</th>
<th>email</th>
</tr>
</thead>
<tbody>
<tr st-select-row="row" st-select-mode="single" ng-repeat="row in rowCollection">
<td>{{row.firstName | uppercase}}</td>
<td>{{row.lastName}}</td>
<td>{{row.birthDate | date}}</td>
<td>{{row.balance | currency}}</td>
<td><a ng-href="mailto:{{row.email}}">email</a></td>
</tr>
</tbody>
</table>
</div>
</div><!-- end card -->
和控制器中的数据
$scope.rowCollection = [
{ firstName: 'Laurent', lastName: 'Renard', birthDate: new Date('1987-05-21'), balance: 102, email: 'whatever@gmail.com' },
{ firstName: 'Blandine', lastName: 'Faivre', birthDate: new Date('1987-04-25'), balance: -2323.22, email: 'oufblandou@gmail.com' },
{ firstName: 'Francoise', lastName: 'Frere', birthDate: new Date('1955-08-27'), balance: 42343, email: 'raymondef@gmail.com' }
];
我的问题是智能表的功能不起作用,stSelectRow
无效,没有功能正常工作。我想我错过了Css,但除了CSS
文件之外我没有找到任何JS