I have an angular application that uses Stripe to save customer payment card info.
I include this script in my index.html
<script src="https://js.stripe.com/v3/"></script>
this script provides a "Stripe" object that I can use like this:
<script> var stripe = Stripe('pk_XXXXXXXXXXX') </script>
the question is: How can I access the Stripe object from my angular typescript code?
Try to use
for angular typescript version.
Register the type in typings.d.ts
Instantiate a Stripe object from a Service
Now you can inject this service into your components and interact with elements, but make sure to use AfterViewInit.