I’m a beginner in Angular, would anyone know how to solve a dependency problem . map of the following code?

Asked

Viewed 60 times

-1

import { Injectable } from '@angular/core';
import { AngularFireAuth } from 'angularfire2/auth';
import { Observable } from 'rxjs';
import * as q from 'q';

@Injectable({
  providedIn: 'root'
})
export class AuthService {

  constructor(private afAuth: AngularFireAuth) { }

  login(email: string, password: string) {
    return new Promise((q.resolve, q.reject)) => {
      this.afAuth.auth.signInWithEmailAndPassword(email, password)
      .this(userData => q.resolve(userData),
      err => q.reject(err))
    });
  }
  getAuth() {
    return this.afAuth.authState.map((auth => auth);
  }
  logout() {
    this.afAuth.auth.signOut();
  }
}

The following error message appears: Property 'map' does not exist on type 'Observable'. ts

1 answer

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.