Angularjs 如何使用进度通告

Angularjs 如何使用进度通告,angularjs,ecmascript-6,angular-material,Angularjs,Ecmascript 6,Angular Material,我有我的按钮,当我在按钮上输入时,我想使用,但是内容还没有上传,所以我想在按钮上显示这个微调器,但我不知道如何操作:(这是一个非常基本的示例,可以使用ng show或ng,如果 <div ng-app='home'> <div ng-controller="MainCtrl"> <md-button class="md-primary md-accent md-raised" ng-click="func()"> My button<md-p

我有
我的按钮
,当我在按钮上输入时,我想使用
,但是内容还没有上传,所以我想在按钮上显示这个微调器,但我不知道如何操作:(

这是一个非常基本的示例,可以使用ng show或ng,如果

<div ng-app='home'>
<div ng-controller="MainCtrl">
  <md-button class="md-primary md-accent md-raised" ng-click="func()">
    My button<md-progress-circular ng-show="processing" md-mode="indeterminate"></md-progress-circular>
  </md-button>
</div>
</div>
请注意,$timeout是为了模拟一个承诺或“按您所说上传内容”所需的时间

$scope.func = function(){
  $scope.processing = true;
  $timeout(function(){
    $scope.processing = false;
  },3000);
};