Answer the question
In order to leave comments, you need to log in
How to set exceptions for variables in typescript?
The script uses the jquery variable $. It is connected on the page by a separate library. Therefore, in type script, when transpiling, an error is displayed when $. Although the code works. Is there a way to add this variable to the exceptions somehow?
Answer the question
In order to leave comments, you need to log in
For typescript, there are a large number of packages with types. In npm they are prefixed with "@types". In order to connect jQuery typing to your project, you need to write in the console: "npm install --save-dev @types/jquery". Next, just import the desired entity from jQuery into your module.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question