ionic-framework - 浏览器错误上的离子facebook firebase应用程序
问题描述
当我在浏览器上运行 ionic facebook firebase 应用程序时,出现错误
HomePage.html:8 ERROR TypeError: Object(...) is not a function
at Facebook.login (index.js:27)
at HomePage.webpackJsonp.230.HomePage.loginWithFacebook (home.ts:20)
at Object.eval [as handleEvent] (HomePage.html:8)
at handleEvent (core.js:13589)
at callWithDebugContext (core.js:15098)
at Object.debugHandleEvent [as handleEvent] (core.js:14685)
at dispatchEvent (core.js:10004)
at core.js:10629
at HTMLButtonElement.<anonymous> (platform-browser.js:2628)
at t.invokeTask (polyfills.js:3)
我的 home.ts 文件是
loginWithFacebook(): Promise<any> {
return this.facebook.login(['email'])
.then( response => {
const facebookCredential = firebase.auth.FacebookAuthProvider
.credential(response.authResponse.accessToken);
firebase.auth().signInWithCredential(facebookCredential)
.then( success => {
alert("Firebase success: " + JSON.stringify(success));
});
}).catch((error) => { console.log(error) });
}
我的 home.html 文件是
<ion-content padding>
<button ion-button (click)="loginWithFacebook()">Login With Facebook</button>
</ion-content>
我真的被困在这里了......
解决方案
推荐阅读
- java - 在java android中转换(ArrayLists)
- typescript - TypeScript mixin 受限于不同的类
- javascript - 如何将光标放在输入选项卡中
- postgresql - 在 Amazon Linux 上启动 postgres SQL 9.6 服务器返回无法识别的服务
- python-3.x - 带有变量的python3请求正文
- r - Rcpp - 无法访问 StringvgVector 的元素
- raku - Perl6 IO::Socket::Async 截断数据
- mysql - 使用 maxdate 更新行,其中给出了 select 的 id 和 select 的 maxdate
- c# - 测量按钮 1 单击和按钮 2 单击之间的时间
- asp.net - 移动设备在使用桌面访问页面后不会获得 View.Mobile.cshtml 视图