【发布时间】:2017-02-12 10:18:31
【问题描述】:
Ionic2 现在使用 @types 来支持第三方库。
我安装了
npm install --save @types/gapi.auth2
但我不知道如何添加我的项目来使用它。请帮帮我
【问题讨论】:
标签: typescript ionic2 google-api-js-client
Ionic2 现在使用 @types 来支持第三方库。
我安装了
npm install --save @types/gapi.auth2
但我不知道如何添加我的项目来使用它。请帮帮我
【问题讨论】:
标签: typescript ionic2 google-api-js-client
安装@types/gapi.auth2 后应该很容易,只需在compilerOptions 部分的tsconfig.json 中添加以下行:
"types": ["gapi.auth2"]
并确保您使用的是 typescript 2.x
希望这会有所帮助。
【讨论】:
import { GoogleAuth } from '@types/gapi.auth2'; ?
import { GoogleAuth } from 'gapi.auth2';