Klas Mellbourn
Klas Mellbourn

Reputation: 44377

How to include definitely typed files in an Angular2 angular-cli based project

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

Answers (1)

Fabio Antunes
Fabio Antunes

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

Related Questions