我有一个宠物项目,使用Angular2-Akita-Firebase实施。
秋田服务中 或 代码:firebase auth
的哪种实现更好?import { FirebaseApp } from '@angular/fire';
private auth = this.app.auth();
import * as firebase from 'firebase';
private auth2 = firebase.auth();
import { Injectable } from '@angular/core';
import { UserStore } from './user.store';
import { CollectionConfig } from 'akita-ng-fire';
import { AngularFirestore } from '@angular/fire/firestore';
import { FirebaseApp } from '@angular/fire';
import * as firebase from 'firebase';
@Injectable({ providedIn: 'root' })
@CollectionConfig({ path: 'users' })
export class UserService {
constructor(
private store: UserStore,
private db: AngularFirestore,
private app: FirebaseApp
) {
}
private collection = this.db.collection('users');
private auth = this.app.auth();
private auth2 = firebase.auth();
login(user: User) {
this.auth.signInWithEmailAndPassword(user.email, user.password); }
}
0 个答案:
没有答案