angularjs - Submit a form only once with JSAngular? Clicked multiple times -


is there way me have end-user submit form once database if he/she clicks multiple times? i'm using angular process submissions, i've tried methods remove post , methods, have ideas put me in right direction?

             },               controller: function ($scope, $modalinstance) {                    $scope.close = function () {                       $modalinstance.close();                   };                    $scope.submitfeedback = function () {                            $scope.feedback = {                           feedbackrating: $scope.score,                           feedbacksubject: $scope.subject,                           feedbackupload: 'upload',                           feedbackdescription: $scope.description                       }; 

the way is:

$rootscope.isloading = function () {     return $http.pendingrequests.length > 0; } 

and on html:

<button type="submit" ng-disabled="isloading()"> 

basically, what's happening here button gets disabled request made.

make sure add $http dependency in controller.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -