在$ http帖子中显示进度循环? [英] Show progress circular during $http post?
本文介绍了在$ http帖子中显示进度循环?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Angular Material的进度通告具有 $ http
请求的组件?
What is the best way to use Angular Material's Progress circular component with a $http
request?
我目前的代码如下:
进度通函:
<md-progress-circular ng-if="determinateValue === 100" md-mode="determinate" value="{{determinateValue}}"></md-progress-circular>
$ http
request:
$scope.determinateValue = 0;
$http.get("/posts")
.success(function (data) {
$scope.posts = data;
$scope.determinateValue = 100;
})
推荐答案
我不认为你需要值
属性,其中确定
模式。相反,你应该使用 indeterminate
模式,然后使用 ngShow
显示和隐藏进度指示器。
I don't think you need the value
attribute here with determinate
mode. Instead you should use indeterminate
mode, then show and hide the progress indicator using ngShow
.
<md-progress-circular md-mode="indeterminate" ng-show="isLoading"></md-progress-circular>
在你的JS中
$scope.isLoading = true;
$http.get("/posts")
.success(function (data) {
$scope.isLoading = false;
});
这篇关于在$ http帖子中显示进度循环?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文