Show progress circular during $http post?

后端 未结 7 1580
旧巷少年郎
旧巷少年郎 2021-02-08 15:56

What is the best way to use Angular Material\'s Progress circular component with a $http request?

I currently have the code like this below:

Progre

7条回答
  •  生来不讨喜
    2021-02-08 16:27

    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.

    
    

    And in your JS

    $scope.isLoading = true;
    $http.get("/posts")
       .success(function (data) {
            $scope.isLoading = false;
       });
    

提交回复
热议问题