I have an error in the declaration file of angular:
TS2304: Cannot find name 'JQueryStatic'.
I do have the typings of jquery installed. There, JQueryStatic is declared as an interface.
How can I solve it?
I have an error in the declaration file of angular:
TS2304: Cannot find name 'JQueryStatic'.
I do have the typings of jquery installed. There, JQueryStatic is declared as an interface.
How can I solve it?
Same problem with me. (Angular 6)
Here's how I resolved it:
Step 1: npm install jquery
Step 2: npm install --save-dev @types/jquery
Step 3: Go to file angular.json Add code below in scripts: [...]
"node_modules/jquery/dist/jquery.min.js"
Step 4: Go to file src/typings.d.ts Add code below
import "jquery";
declare var $: JQueryStatic;
declare var jQuery: JQueryStatic;
Now you can use $ or jQuery inside the typescript component.