Par*_*ani 2 typescript ionic2 ionic-native ionic3 angular
错误错误:没有Facebook提供商!
 at injectionError(core.es5.js:1231)
 at noProviderError(core.es5.js:1269)
 at ReflectiveInjector_.throwOrNull(core.es5.js:2770)
 at ReflectiveInjector.getByKeyDefault(core.es5.js:2809)
 at ReflectiveInjector.getByKey(core.es5.js:2741)
 at ReflectiveInjector获得(core.es5.js:2610)
 at AppModuleInjector.NgModuleInjector.get(core.es5.js:3578)
 at resolveDep(core.es5.js:11039)
 at createClass(core.es5.js:10903)
at createDirectiveInstance(core.es5.js:10723)
View_MyApp_Host_0 @ MyApp_Host.html:1
您需要添加Facebook
在你的AppModule
(app.module.ts
文件):
// ...
import { Facebook } from '@ionic-native/facebook';
@NgModule({
declarations: [...],
imports: [...],
bootstrap: [IonicApp],
entryComponents: [...],
providers: [
// ...
Facebook // <--- Here!
// ...
{ provide: ErrorHandler, useClass: IonicErrorHandler }
]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)
所选答案适用于 Ionic3。对于Ionic 4 +:在任何具有使用 FB 登录的组件 的模块中,添加:
import { Facebook } from '@ionic-native/facebook/ngx';
Run Code Online (Sandbox Code Playgroud)
[注意/ngx]
并添加该 @NgModule 的提供者
providers: [ Facebook, .... ]
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1725 次 |
最近记录: |