GooglePlus class 在 Ionic 应用程序中没有来自 Cordova 插件的登录功能
GooglePlus class doesn't have login function from Cordova plugin in Ionic app
我正在尝试按照 this tutorial for using GooglePlus login within an Ionic app. I have installed the plugin by Eddy Verbruggen 进行操作,根据教程,我应该将这一行放在 home.ts
的顶部。
import { GooglePlus } from 'ionic-native';
Ionic 在我尝试构建它时抱怨。改成这个有帮助
import { GooglePlus } from '@ionic-native/google-plus';
但是现在下面的代码不会转译
GooglePlus.login({.....
因为"Property 'login' does not exist on type 'typeof GooglePlus'"。使用 WebStorm,我可以控制点击 GooglePlus,它会带我到 node_modules/@ionic-native/google-plus
中的 class 定义,它显示 class 显然有一个名为登录的功能。
- npm 5.5.1
- 离子 3.19.0
- 科尔多瓦 7.1.0
- OS X 10.12.6
我需要从教程中进行的这些更改在 Ionic's docs
中有部分详细说明
1) 将 GooglePlus 添加到构造函数中
constructor(private googlePlus: GooglePlus) { }
2) 将 GooglePlus.login()
更改为 this.googlePlus.login
3) 导入 GooglePlus 并将其添加为 app.module.ts
中的提供商
import { GooglePlus } from '@ionic-native/google-plus';
...
providers: [
GooglePlus
]
我正在尝试按照 this tutorial for using GooglePlus login within an Ionic app. I have installed the plugin by Eddy Verbruggen 进行操作,根据教程,我应该将这一行放在 home.ts
的顶部。
import { GooglePlus } from 'ionic-native';
Ionic 在我尝试构建它时抱怨。改成这个有帮助
import { GooglePlus } from '@ionic-native/google-plus';
但是现在下面的代码不会转译
GooglePlus.login({.....
因为"Property 'login' does not exist on type 'typeof GooglePlus'"。使用 WebStorm,我可以控制点击 GooglePlus,它会带我到 node_modules/@ionic-native/google-plus
中的 class 定义,它显示 class 显然有一个名为登录的功能。
- npm 5.5.1
- 离子 3.19.0
- 科尔多瓦 7.1.0
- OS X 10.12.6
我需要从教程中进行的这些更改在 Ionic's docs
中有部分详细说明1) 将 GooglePlus 添加到构造函数中
constructor(private googlePlus: GooglePlus) { }
2) 将 GooglePlus.login()
更改为 this.googlePlus.login
3) 导入 GooglePlus 并将其添加为 app.module.ts
import { GooglePlus } from '@ionic-native/google-plus';
...
providers: [
GooglePlus
]