Created
November 3, 2015 20:10
-
-
Save iBasit/2fcbc077231265f3d7f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.directive('mysubmit', function(){ | |
return { | |
restrict: 'A', | |
require: '^form', | |
link: function(scope, element, attrs, formCtrl) | |
{ | |
console.log('found it'); | |
element.on('click', function(event) | |
{ | |
console.log('submitting form') | |
//do stuff before submitting | |
formCtrl.submit(); //manually submitting form in angular way. | |
$scope.$apply(); //running digest manually | |
}) | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment