reynaerta reynaerta - 6 months ago 75
AngularJS Question

VSCode Angular & typings: no intellisense

I try to set up a new project with angular 1.5.5 and I want to make use of typescript for my code. I use Visual Studio Code as my coding tool.

I added the typings for angular to my project:

typings install angular --save --ambient


I added a typings.d.ts file and a tsconfig.json file but I don't have intellisense any of the .ts files I've added...


Don't know what am I doing wrong? Can someone help me?
I try setup small project to reproduce the problem: download link

Great thx in advance!

Alexander.

Zen Zen
Answer

Your file structure is wrong:

  1. tsconfig.json should be on the root directory of you app, i.e. AngularApp.
  2. usually, typings.d.ts is there as well.

After you move these two files, remember to change the path inside them. Ts files must be included.

//tsconfig.json
{
//...
  "files":[  
    "typings.d.ts",
    "public/app/app.ts"
  ]
}

//typings.d.ts
/// <reference path="typings/browser.d.ts" />

If you want to download.

Comments