What I am trying to do, installing typescript jquery and boostrap definition file in my new project using npm typings.
Below is the steps which I followed.
1- open cmd and goto my currrent project folder and type following commands.
npm install typings --global
typings init
typings install dt~jquery --global --save
typings install dt~boostrap --global --save
2- below is my tsconfig file configuration
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"rootDir": "./TS",
"outDir": "./JS",
"watch": true
}
}
Note: I created separate folder for TS file and JS file. So when typescript transpile, it create javascript file in JS directory.
3- Add document.ready
function in ts file and write alert when page load
4- Build and run index.html file
Note: I add transpile javascript in head section so there is no need to mention here any code.
Error: In browser console window its shows me below error:
myscript.ts:2 Uncaught ReferenceError: $ is not defined
Here is my repository.
Please help me here. What I am doing wrong to installing jquery in my project.