How do you disable the submit button after a single click to prevent multiple submissions in Angularjs?

前端 未结 10 2002
礼貌的吻别
礼貌的吻别 2020-12-23 14:35

I\'ve looked all over the web including several stack overflow examples for a solution to the question. To be specific, I tried this:

10条回答
  •  生来不讨喜
    2020-12-23 15:07

    Find the working example also.

    HTML

      
            

    JS:

    angular.module('DisableButtonApp', [])
        .controller('MyAppCtrl',['$scope', function($scope){
        $scope.isDisabled = false;
        $scope.someFunc = function(){
            alert("Clicked!");
            $scope.isDisabled = true;
            return false;
        };
    }]);
    

    Demo

提交回复
热议问题