How to install intellisense for Angular.Js and Javascript in Visual Studio code without adding a link to a TypeScript file in each js file

I am new to VS Code and want to use it to develop an AngularJs application. However, I had the problem of adding a link at the top of all files js.

like this.

 /// <reference path="path/to/typings/tsd.d.ts" />

is there an alternative to this?

+4
source share
2 answers

By default, all JavaScript files opened in Visual Studio Code are treated as independent units. If you want to enable IntelliSense for the entire project, be sure to place the file jsconfig.jsonin the root of your project.

jsconfig.json, JavaScript ES6 node_modules.

{
  "compilerOptions": {
    "target": "ES6",
    "module": "commonjs",
    "allowSyntheticDefaultImports": true
  },
  "exclude": [
    "node_modules"
  ]
}

IntelliSense AngularJS .d.ts DefinitelyTyped . Typings .

, npm install typings --global. npm. AngularJS typings install dt~angular --global. DefinitelyTyped .

typings search angular.

IntelliSense ///.

VS.

, !

+6

, Linux Ubuntu 16.04 x64

npm init

sudo npm install -g typings

sudo ln -s /usr/bin/nodejs /usr/bin/node

typings install dt~angular --save --global

touch jsconfig.json

UPDATE:

AngularJS.

Angular2 + angular -cli .

, Angular 2

+1

Source: https://habr.com/ru/post/1651146/


All Articles