I am trying to get AJAX working in typescript, so i've found a way how to add Jquery to Typescript. I called these commands in VS code terminal:
npm install jquery --save
npm install --save @types/jquery
npm install @types/jquery --save-dev
After that i added these rows at the top of my main typescript file:
import jquery = require("jquery");
const $: JQueryStatic = jquery;
After I use tsc scripts.ts
i get scripts.js
file and move generated .js file to the project i get the error in the chrome browser: Uncaught ReferenceError: exports is not defined
.
https://i.stack.imgur.com/u1WAn.png
This is not react or angular project.
I don't know why, but it hard to find working answer on my question.. It seems like majority is using react or angular, so answers not fits to my problem.
All i want is to use AJAX calls via Typescript.