ehiller
ehiller

Reputation: 1557

Typescript Angular2 Typings d.ts in Visual Studio Code

Quite possible that I am really missing something. But for the life of me I can not get typings to work for Typescript + Angular2. Not with /// per file nor for the entire workspace. I have tried manually grabbing the source of angular2 off github and putting in a /typings directory within the workspace. I have tried using tsc to install angular2 typings I have tried the tsd.json file that Badal in this Stack Overflow thread was nice enough to post. But no matter what Vscode continues to say Cannot find module <blerg> (ie. angular2/core, angular2/common, etc...) And its driving me nuts!

Any help would be GREATLY appreciated!

Upvotes: 3

Views: 2579

Answers (2)

Vinicius Quaiato
Vinicius Quaiato

Reputation: 85

I don't think there is already an extension for installing .td directly from VS CODE. Besides that the Angular definitions are shipped with the Angular2 package from npm:

npm install angular2

The npm package already gives you the definitions. You need to configure your Typescript with:

--moduleResolution node

Upvotes: 3

basarat
basarat

Reputation: 276135

But no matter what Vscode continues to say Cannot find module

You probably forgot to restart vscode after following the basic guide.

npm install angular2
tsc -init
code .

Upvotes: 1

Related Questions