Van*_*anz 1 ionic-framework google-plus-signin angular ionic5
我无法在不出现此错误的情况下导入 GooglePlus。
\n控制台错误
\n\n\n错误错误:未捕获(承诺):错误:类型 GooglePlus 不\n具有“\xc9\xb5mod”属性。\ngetNgModuleDef@http://localhost:8100/vendor.js:57098:15\nrecurse@http://本地主机:8100/vendor.js:81227:35\nrecurse@http://localhost:8100/vendor.js:81238:24
\n
tab1/tab1.module.ts
\n...\nimport { Tab1PageRoutingModule } from './tab1-routing.module';\nimport { GoogleSignupComponent } from './google-signup/google-signup.component';\nimport { GooglePlus } from '@ionic-native/google-plus/ngx';\n\n@NgModule({\n imports: [\n ...\n Tab1PageRoutingModule,\n GooglePlus\n ],\n declarations: [Tab1Page, GoogleSignupComponent],\n})\nexport class Tab1PageModule { }\nRun Code Online (Sandbox Code Playgroud)\ntab1/google-signup/google-signup.component.ts
\n...\nimport { GooglePlus } from '@ionic-native/google-plus/ngx';\n@Component({\n selector: 'app-google-signup',\n templateUrl: './google-signup.component.html',\n styleUrls: ['./google-signup.component.scss'],\n})\nexport class GoogleSignupComponent implements OnInit {\n\n constructor(private googlePlus: GooglePlus) { }\n\n ngOnInit() { }\n\n public google() {\n console.log('google signup');\n this.googlePlus.login({})\n .then(res => console.log(res))\n .catch(err => console.error(err));\n }\n ...\n}\nRun Code Online (Sandbox Code Playgroud)\n我在用:
\n您正在尝试导入GooglePlus您的ngModule导入内容。没有必要这样做。文档
编辑:
有时您需要为provider您的ngModule. 你可以试试这个:
@NgModule({
imports: [...],
providers: [GooglePlus],
...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1793 次 |
| 最近记录: |