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!
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
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 .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With