1
HTML代碼信息後:動態生成的表是臨危從服務
<table class="table table-bordered table-striped">
<thead>
<tr>
<td>one</td>
<td>two</td>
<td>three</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="color in colors">
<td>{{ color.one }}</td>
<td>{{ color.two }}</td>
<td>{{ color.three }}</td>
</tr>
</tbody>
</table>
控制器:
var SomeController = function ($scope, SomeService, $window) {
var colors= [];
SomeService.someFunction().success(function (data, status, header, config) {
colors= data;
}).error(function (data, status, headers, config) {
// handle error
});
};
基本上,我需要動態地創建基於無論是在後臺我的表...然而,問題在於,一旦我呼叫該頁面,它會自動加載列,稍後一秒左右,它就會從服務中恢復。無論如何,我可以延遲加載時間,或讓表格「刷新」自己以顯示新數據。
不包括''訂閱到像範圍'$ scope.subscriptions = data'&然後'NG-repeat'would是'TR NG重複=」訂閱的訂閱「> {{subscription.one}} {{subscription.two}} {{subscription.three}} ' –