From aba9d94656c089937c1b10aba4f945cc00626ce2 Mon Sep 17 00:00:00 2001 From: Jake Albaugh Date: Fri, 20 Feb 2015 12:25:27 -0600 Subject: [PATCH] Init Parameter Added an Init method to be called prior to Stripe Response on form submit. Disabling the button wasn't enough in my use case. --- stripe-angular.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stripe-angular.js b/stripe-angular.js index 3ae33e5..1018d46 100644 --- a/stripe-angular.js +++ b/stripe-angular.js @@ -5,6 +5,9 @@ function($window) { directive.link = function(scope, element, attributes) { var form = angular.element(element); form.bind('submit', function() { + if (attributes.stripeInit) { + scope[attributes.stripeInit].apply(); + } var button = form.find('button'); button.prop('disabled', true); $window.Stripe.createToken(form[0], function() {