angularfire
angularfire copied to clipboard
Module '"@angular/fire/auth"' has no exported member 'AngularFireAuth'.ts(2305) . please help me to solve this issue
Version info
Angular:
Firebase:
AngularFire:
Other (e.g. Ionic/Cordova, Node, browser, operating system):
How to reproduce these conditions
Failing test unit, Stackblitz demonstrating the problem
Steps to set up and reproduce
Sample data and security rules
Debug output
** Errors in the JavaScript console **
** Output from firebase.database().enableLogging(true);
**
** Screenshots **
Expected behavior
Actual behavior
Can you provide Code examples?
You have to import from compat
if you still want to use old modules: @angular/fire/compat/auth
.
Angular Fire v7 upgrade.
Import it in module like this.
import {provideAuth, getAuth} from '@angular/fire/auth';
and then add this into the imports list in aap.module.ts
imports : [ provideAuth(() => getAuth()) ]
An example of a signInAnonymously method in v7
import { Injectable } from '@angular/core';
import { Auth, signInAnonymously } from '@angular/fire/auth';
import { UserDataService } from '../userData/user-data.service';
@Injectable({
providedIn: 'root'
})
export class AuthorizationService {
constructor(private auth:Auth,private userData:UserDataService) {
console.log('AuthorizationService',auth.name);
}
loginAnonymously(){
signInAnonymously(this.auth).then(credential=>{
console.log('signInAnonymously',credential);
this.userData.addNewUser();
console.log('add new user')
});
}
}
A full fledged documentation will be very helpful. There are simply too many breaking changes in this version.
Here is the full-fledged documentation for your need. https://dev.to/jdgamble555/angular-12-with-firebase-9-49a0