angularjs disable button on $http/$q calls

前端 未结 9 774
失恋的感觉
失恋的感觉 2021-02-03 10:12

following the DRY principal, i want to write a button directive which keeps button disabled for the duration of $http class.

I want to do this so as to forbid user from

9条回答
  •  遥遥无期
    2021-02-03 11:09

    I've prepared directive on plnkr which overrides default ngClick directive

    
    

    and controller:

    $scope.loadData = function($notify) {
        $timeout(function() {
          $notify && $notify();
        }, 1000);
      }
    

提交回复
热议问题