在$ http post请求时在Ionic框架中显示微调器

时间:2016-09-22 05:09:07

标签: ionic-framework angular-http

感谢您查看此问题。 如何在Ionic框架中完成$ http post请求时显示微调器?

1 个答案:

答案 0 :(得分:0)

您可以从离子微调器here

获取所有详细信息

在你的html模板文件中,使用像这样的离子微调器。

<ion-spinner icon="spiral" ng-if="isLoading"></ion-spinner>

并且在您的控制器文件中,您可以使微调器像这样工作,

$scope.isLoading = true;
$http.post(url, body,config).succcess(function(res) {
      $scope.isLoading = false;
})
.error(function(err) {
      $scope.isLoading = false;
});