html
<table st-table="ApplicationData.displayedCollection" class="table table-striped" st-safe-src="ApplicationData.source">
<thead>
<tr ng-repeat="col in ApplicationData.columns">
<td st-sort="{{col.name}}">{{col.caption}}</td>
</tr>
</thead>
js
$scope.ApplicationData = {
source: [],
displayedCollection: [],
columns: [{ name: 'APPLICATION_CODE', caption: 'Code', isSort: true },
{ name: 'APPLICATION_NAME', caption: 'Application', isSort: true }],
};
输出
<table st-table="ApplicationData.displayedCollection" class="table table-striped" st-safe-src="ApplicationData.source">
<thead>
<tr ng-repeat="col in ApplicationData.columns" class="ng-scope">
<td class="ng-binding">Code</td></tr>
<tr ng-repeat="col in ApplicationData.columns" class="ng-scope">
<td class="ng-binding">Application</td></tr>
</thead>
</table>
嗨,我正在使用这个 html 来动态生成列,但是每次我尝试我都会得到动态生成的行。请查看我随附的代码并让我知道问题所在。