沒有更新UI我使用下面庫訪問索引資料中Angularjs上一個新的Chrome應用:https://github.com/aaronpowell/db.jsIndexedDB的回調angularjs
當我嘗試通過使用此更新應用程序啓動時的UI:
db.orders.query().all().execute().done(function(results) {
$scope.ordercount = results.length;
});
在我的main.html中我已經使用了定單計數變量:
Orders : {{ordercount}}
然而,UI沒有更新,除非我不NG單擊或任何其他NG-*事件。我需要的是顯示我的應用程序加載時的訂單數量。我嘗試了$ scope.apply(),但它會拋出錯誤,說apply()不可用。
請幫忙。
該死!我使用$ scope.apply()而不是$ scope。$ apply()。謝謝! –