0

I'm new to Angular and I have created a new app using the angular CLI command.

Whilst Angular 8.0.9 uses TypeScript (which then gets transpiled to JavaScript under the hood), I would like to use a javascript library to perform some useful operations. Unfortunately this library does not have a equivalent TypeScript/ Angular library.

I was wondering if it's possible to add JavaScript code inside an Angular based web-app. I read on google searches that this is not considered to be best practice, but wanted to ask if it was possible?

thanks

rm12345
  • 1,089
  • 3
  • 18
  • 32
  • 3
    Does this answer your question? [How do I include a JavaScript script file in Angular and call a function from that script?](https://stackoverflow.com/questions/44817349/how-do-i-include-a-javascript-script-file-in-angular-and-call-a-function-from-th) – takendarkk Jan 22 '21 at 18:36
  • you absolutely can include a JavaScript library that doesn't have TypeScript type definitions. It just means that your IDE will not be able to provide any intellisense when calling functions from that library and the compiler will not be able to catch errors. So if you have a coding error when you call that library, you will only detect it at runtime. – Sam Herrmann Jan 22 '21 at 18:40
  • This certainly answers my question. Thank you both. – rm12345 Jan 22 '21 at 19:26

0 Answers0