Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set intellisense for Angular.Js and Javascript in Visual Studio Code

Tags:

angularjs

I am trying to use Angular.js in Visual Studio Code. But it's not working. In visual studio 2013 I am able to get the IntelliSense, but not in Visual Studio Code.

like image 308
Kokirala Sudheer Avatar asked May 13 '15 05:05

Kokirala Sudheer


People also ask

How do I change VS Code in IntelliSense?

Your compiler path and IntelliSense mode configuration are stored in your project's c_cpp_properties. json file. Edit these settings by selecting C/C++: Edit Configurations (UI) from the Command Palette. Under Compiler path, enter the path to the compiler compatible with your target architecture.


2 Answers

In Visual Studio Code, just install following npm package and will get intellisense for JavaScript files.

npm install --save-dev @types/angular

enter image description here

enter image description here

enter image description here

enter image description here

like image 101
Advait Baxi Avatar answered Oct 18 '22 13:10

Advait Baxi


The answer provided here is no longer valid as tsd was deprecated. To install angular or any other Typescript Definition, please follow the next steps. Provided that you already have a package.json file and a jsconfig.json file:

  1. First we will want to install typings globally: npm install typings --global;
  2. Then, at root level on your directory run: typings install dt~angular --global --save.

You should now be able to have IntelliSense on your project.

ProTip! Include typings/ on you .gitignore file before running the second command, to prevent git from watching changes to the newly generated folder for typings. You can also do that for typings.json, but I do not recommend it. Up to you.

I got the information from the github repository readme file and from this post by Laurent Duveau.

Hope it helps.

like image 31
Edd Avatar answered Oct 18 '22 13:10

Edd