I've installed @types/stripe-v3
and included Stripe's javascript file in a script tag in index.html
. Supposedly the Angular compiler should include all files automagically from the @types node modules. Reading up on the internet and looking at @types/stripe-v3/index.d.ts
there should be a var Stripe declared globally if the file is included by the compiler. From index.d.ts
declare var Stripe: stripe.StripeStatic;
In my service file I have the following code:
import { Injectable } from '@angular/core';
import { environment } from '../environments/environment';
@Injectable({
providedIn: 'root'
})
export class BetalingService {
stripe = Stripe(environment.stripeKey);
constructor() { }
}
Resulting in the following error:
error TS2304: Cannot find name 'Stripe'.