我有一個後端服務,它將數據發送到$scope
變量。我正在使用這個變量來填充表中的行,使用ng-repeat
。ng-repeat在顯示控制器的行之前顯示一行
加載頁面時,瀏覽器會顯示一行,頁面加載完成後突然消失。有一段時間,當我檢索到數據時,所需的行按預期填充。
我想刪除第一行,因爲它看起來不好。
下面是代碼:
...
<tr ng-repeat="row in rows">
<td ng-bind="row.vname"></td>
<td ng-bind="row.mname"></td>
<td ng-bind="row.time_start"></td>
<td ng-bind="row.time_end"></td>
<td ng-if="row.progress!='-1'">
<p class="btn-info btn-rounded" style="text-align: center; font-weight: bold;"> Complete</p>
</td>
<td ng-if="row.progress=='-1'">
<p class="btn-danger btn-rounded" style="text-align: center; font-weight: bold;"> Failed</p>
</td>
</tr>
</tbody>
...
它顯示在開頭的行顯示兩個圓形按鈕與文字「完全」和「失敗」。
確保你的'$ scope.rows = []'當應用程序只是加載 – manish
@manish'$ scope.rows'在從後端渲染數據的函數中初始化。空行不顯示'$ scope.rows'的數據 –