Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ionic framework 如何使用进度百分比更新$ionicLoading?_Ionic Framework_Ionic - Fatal编程技术网

Ionic framework 如何使用进度百分比更新$ionicLoading?

Ionic framework 如何使用进度百分比更新$ionicLoading?,ionic-framework,ionic,Ionic Framework,Ionic,正在处理Ionic项目,并使用$ionicLoading显示下载进度(此进度需要锁定UI)。 因此,如何使用$ionicLoading将进度百分比(文本)更新为?只需调用$ionicLoading.show({template:'updated text'}),它将再次替换下一次。我建议使用scope属性: // In your controller or us any scope you want. $scope.uploadProgress = 0; // update this in yo

正在处理Ionic项目,并使用
$ionicLoading
显示下载进度(此进度需要锁定UI)。
因此,如何使用
$ionicLoading
将进度百分比(文本)更新为?

只需调用
$ionicLoading.show({template:'updated text'})
,它将再次替换下一次。

我建议使用scope属性:

// In your controller or us any scope you want.
$scope.uploadProgress = 0; // update this in your progress callback

// show once
$ionicLoading.show({
  scope: $scope,
  template: '<p>Saving...</p><p>{{uploadProgress}}</p><ion-spinner></ion-spinner>'
});
//在您的控制器或我们的任何范围内。
$scope.uploadProgress=0;//在进度回调中更新此项
//表演一次
$ionicLoading.show({
范围:$scope,
模板:'正在保存…

{{uploadProgress}}

' });