I am encountering an issue with a Braintree payment form displayed in a modal window:
$scope.displayModalBraintree = function () {
$scope.modal = 'modal_payment_form.html', $scope.$on('$includeContentLoaded', function () {
braintree.setup('tokenStringFromServer', 'paypal', {
container: 'paypal',
locale: 'da_dk',
onReady: function (integration) {
console.log('ready', integration)
}
})
})
})
When I click the button to trigger displayModalBraintree, everything works correctly the first time. However, if I click the button again, two Paypal buttons appear and the log shows "ready ready".
I have attempted to resolve this issue by using the teardown method as suggested at https://github.com/braintree/braintree-web/issues/29#issuecomment-137555915, but it has not resolved the problem.