如何在点击按钮上显示<md-progress-linear md-mode =“indeterminate”>?

时间:2016-05-09 15:50:27

标签: angularjs

我正在上传一个文件,因为我必须显示进度条,但应该在点击上传按钮后         “                     开始上传                        “

1 个答案:

答案 0 :(得分:0)

<md-dialog-actions style="height: 75px;"> 
  <md-button ng-disabled="disableUploadButton" 
             data-ng-click="importSite(myFile)" 
             class="md-primary md-raised">Start Upload 
  </md-button> 
  <md-progress-linear ng-show="uploading" 
                      md-mode="indeterminate" 
                      style="left:0px;position:absolute;">
  </md-progress-linear> 
</md-dialog-actions>

并在控制器中:

$scope.uploading = false;

$scope.importSite = function(myFile){
  $scope.uploading = true;
  // other code
  $scope.uploading = false;
}