using jQuery in TypeScript with Visual Studio Code

If you are building a TypeScript project in Visual Studio Code you will get intellisense and that is cool. But if you want to add jQuery into your ts file the intellisense shows you errors. So how to use it?
All you need to do are some simple steps.

  1. Create the folders structur typings/jquery in your project folder.
  2. Get the latest jQuery type definition (a kind of parsed version) from GitHub. Click Raw and save the file as jquery.d.ts into the typings/jquery folder.
  3. Add a reference in your ts file using the following line:
1
/// <reference path="typings/jquery/jquery.d.ts" />

That's it. Your done.

Comments

Popular posts from this blog

How to support multiple languages in WPF