After spending days researching and struggling, I am reaching out here for clarification on the process of importing a library in Typescript.
I used to just add the script tag and everything would work fine. Now that I am working on building a MEAN-Stack application, I am having trouble understanding how it all works with definition files and such.
WHAT I'VE TRIED SO FAR:
npm install jquery //terminal root: /project/angular-src
npm install @types/jquery //same directory here
Then I imported jQuery in one of my .ts files.
import * as $ from 'jquery';
I have tried different variations of this (installing jQuery and @types/jQuery in the project folder instead of the angular-src folder), but none of them have worked for me. I thought it would be straightforward, but perhaps I am missing something. I keep getting errors like "Generic type 'xyz' requires x arguments" (about 200 lines of these).
Can you please help me understand why this isn't working and how I can make it work?
P.S.: I have come across similar questions here before, but unfortunately, I did not find them helpful as I tried them without success.