Insane Rose
Insane Rose

Reputation: 191

How to use TypeScript definitions @types in ionic2 project

Ionic2 now use @types to support for third-party libraries.

I installed

npm install --save @types/gapi.auth2

But I don't know how to add my project to use it. Please help me

Upvotes: 0

Views: 264

Answers (1)

Amid
Amid

Reputation: 22372

It should be pretty easy after you have installed @types/gapi.auth2, just add in your tsconfig.json in compilerOptions section the following line:

"types": ["gapi.auth2"]

And make sure you are using typescript 2.x

Hope this helps.

Upvotes: 1

Related Questions