How can I display a dynamic value inside of ionicLoading?
Here is my code to show $ionicLoading, the idea here is to display download progress:
$rootScope.updateProgress = 0;
$ionicLoading.show({
template: 'Updating...' + $rootScope.updateProgress
});
And later in my code I update $rootScope.updateProgress's value:
var iPecent = Math.round(downloadProgress.receivedBytes / downloadProgress.totalBytes * 100);
$rootScope.$apply(function () {
$rootScope.updateProgress = iPecent;
});
However, $rootScope.updateProgress's value is not reflected when $ionicLoading is displayed on the screen - just shows initial value of 0. If I log out $rootScope.updateProgress's value it is reflecting current download progress.