R
R
Ramil2017-09-21 17:59:03
JavaScript
Ramil, 2017-09-21 17:59:03

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

1 answer(s)
D
Danakt Frost, 2017-09-21
@Danakt

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 question

Ask a Question

731 491 924 answers to any question