I am following this tutorial here, and the author says to add two declarations to the project's typings.d.ts
file. However, when using the ng-cli
to create the Angular 7 project, there is no such file generated.
In this other article (for Angular 2), the author suggests to create a typings
folder and place the typings.d.ts
there and to modify the tsconfig.json
file with a files
key; doing this gives me a TS5023: Uknown compiler option 'files'.
message.
Yet, in this post, the top answer suggest that typings.d.ts
should have been created with ng-cli
under the src
folder, but I don't see it (I am using Angular CLI v7.3.1).
My question is, for Angular 7, how and where do I add typings.d.ts
? What other files do I need to modify when adding such file?
Just as you yourself said, create the typings.d.ts file in src folder and put your declarations there. That is what I do for stripe and also jquery and works fine.
declare var $: any;
declare var stripe: any;
declare var elements: any;
My latest project is on Angular 8 and worked with the same method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With