Skip to content

Simple angular directive which prevents users from repeatedly clicking a button.

Notifications You must be signed in to change notification settings

rasparac/ib-submit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ib-submit

Simple angular directive which prevents users from repeatedly clicking a button.

Install

  • Using bower and running bower install ib-submit

#How to add to the project

	<script type="text/javascript" src="../bower_components/ib-submit/ib-submit.js"></script>
	angular.module('app', ['ib-submit']);

#Code example Your function must return promise!

Javascript code

	$scope.sendData = function() {
        return sendData($scope.formData).then(function(res) {
            $scope.formData = {};
        });
    };

    function sendData(data) {
        var deferred = $q.defer();
        deferred.resolve(data);
        return deferred.promise; 
    }

##HTML

	<button
		ib-submit
		after-submit-text="Button Text"
		submit-action="sendData()"
    >Submit
    </button>

About

Simple angular directive which prevents users from repeatedly clicking a button.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published