AngularFireAuth --SwitchMap函数类型错误

时间:2018-10-23 04:02:34

标签: angular

我尝试使用Google身份验证。 这样就没有编译错误

import { Component, OnInit } from '@angular/core';
import {AngularFireAuth}from 'angularfire2/auth';
import * as firebase from 'firebase';

@Component({
  selector: 'app-log-in',
  templateUrl: './log-in.component.html',
  styleUrls: ['./log-in.component.css']
})
export class LogInComponent implements OnInit {

  constructor(private afAuth:AngularFireAuth) { 


  }

  ngOnInit() {
  }

  login(){

    this.afAuth.auth.signInWithRedirect(new firebase.auth.GoogleAuthProvider());


  }

I got an error in my browser:-

    core.js:1673 ERROR Error: Uncaught (in promise): TypeError: (intermediate value).switchMap is not a function
TypeError: (intermediate value).switchMap is not a function
    at new AngularFireAuth (auth.js:21)
    at _getAngularFireAuth (auth.module.js:6)
    at _callFactory (core.js:8433)
    at _createProviderInstance (core.js:8389)
    at resolveNgModuleDep (core.js:8349)
    at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:9057)
    at resolveDep (core.js:9422)
    at createClass (core.js:9294)
    at createDirectiveInstance (core.js:9179)
    at createViewNodes (core.js:10399)
    at new AngularFireAuth (auth.js:21)
    at _getAngularFireAuth (auth.module.js:6)
    at _callFactory (core.js:8433)
    at _createProviderInstance (core.js:8389)
    at resolveNgModuleDep (core.js:8349)
    at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:9057)
    at resolveDep (core.js:9422)
    at createClass (core.js:9294)
    at createDirectiveInstance (core.js:9179)
    at createViewNodes (core.js:10399)
    at resolvePromise (zone.js:814)
    at resolvePromise (zone.js:771)
    at zone.js:873
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
    at Object.onInvokeTask (core.js:3811)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
    at drainMicroTaskQueue (zone.js:595)
    at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:500)
    at invokeTask (zone.js:1540)

我认为我的角度Firebase版本不正确:-

Angular Version

这方面您能帮忙吗?我应该为rxjx和angular firebase使用哪些稳定版本

0 个答案:

没有答案