Reputation: 44377
What is the best practice for this scenario:
I have created an Angular2 project using angular-cli
(i.e. using ng new
)
I want to include TypeScript types from definitely typed
For example, should I use typings to install the types? How do I make sure the types are included in the ng build
?
If you answer is that I should hack the webpack
settings somehow, please include how I would do that, since I only have the angular-cli.json
file
Upvotes: 6
Views: 3650
Reputation: 22862
Angular-cli uses typescript 2.0, you just need to search for the typings on npm, say you want jquery types, just install them:
npm install --save @types/jquery
And that's it. More info here
Upvotes: 5