我是 AngularJS 和 Smart Table 的新手……我正在尝试一个简单的 Smart Table 示例,但由于某种原因,我似乎无法显示我的表格数据。
这是我的html:
<body ng-controller="basicsCtrl">
<p>Hello {{name}}!</p>
<table st-table="rowCollection" class="table table-striped">
<thead>
<tr>
<th>first name</th>
<th>last name</th>
<th>birth date</th>
<th>balance</th>
<th>email</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in rowCollection">
<td>{{row.firstName}}</td>
<td>{{row.lastName}}</td>
<td>{{row.birthDate}}</td>
<td>{{row.balance}}</td>
<td>{{row.email}}</td>
</tr>
</tbody>
</table>
</body>
这是我的js:
var app = angular.module('myApp', ['smartTable.table']);
app.controller('basicsCtrl', ['$scope', function (scope) {
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'}
];
scope.name = "World";
}]);
这是我的 plunker 代码: http ://plnkr.co/edit/335mfrwqHQXewqXJ4N0I?p=preview
谢谢!
莎娜