IndexedDB callback not updating UI in angularjs

纵然是瞬间 提交于 2019-12-06 13:31:57

Since you are getting the values from out side of the angular js you need to do it like this,

$scope.$apply(function(){
  $scope.ordercount = results.length;
})

It seems like you access $scope from out side of the angular world. You should get scope object first if you want to notify angular that the data had been updated.

//assume you have a controller named "dbCtrl" e.g., <div id="container" ng-controller="dbCtrl"></div>
angular.element($("#container")).scope().$apply(function(){
  $scope.ordercount = result.length;
});

Hope this is helpful.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!