-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebase APIs outside of an Injection context #3607
Comments
This issue does not seem to follow the issue template. Make sure you provide all the required information. |
I am getting the same error: Line 82 in bc926a8
|
Just read #3590 (comment) |
Resolved using this #3590 (comment) |
not a solution |
No it is not. Just a workaround for now. |
I keep getting error about,
Calling Firebase APIs outside of an Injection context may destabilize your application leading to subtle change-detection and hydration bugs.
I did properly set up the angular firebase integration although signIn, logIn working properly, but this error won't resolve and it makes the authentication delay at each reload.
Appconfig.ts -
const firebaseConfig = {
apiKey: "",
authDomain: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: ""
}
export const appConfig: ApplicationConfig = {
providers:
[
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes),
provideHttpClient(),
provideFirebaseApp(() => initializeApp(firebaseConfig)),
provideAuth(() => getAuth()),
provideFirestore(() => getFirestore())
]
};
Service:
auth: Auth = inject(Auth)
fireStore: Firestore = inject(Firestore)
ngZone = inject(NgZone)
userSubject: BehaviorSubject = new BehaviorSubject(null)
private authSubscription;
constructor() {
this.authSubscription = this.auth.onAuthStateChanged(user => {
this.userSubject.next(user)
})
}
signUp(fullName: string, email: string, password: string, username: string, phone: string = '', address: string = '', pincode: string): Observable {
return this.ngZone.run(() => {
}
saveUserDetails(uid: string, fullName: string, address: string, phone: string, pincode: string): Promise {
const userRef = doc(this.fireStore, 'users', uid)
}
Component:
onSubmit() {
const rawForm = this.signUpForm.getRawValue();
}
The text was updated successfully, but these errors were encountered: