We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
**Angular:17
**Firebase:10
**AngularFire:18.0.1
**Other (e.g. Ionic/Cordova, Node, browser, operating system):**Angular
I am trying to insert data in firebase but getting error
import { Injectable, inject } from '@angular/core'; import { Firestore, collection, collectionData, addDoc, CollectionReference, DocumentReference} from '@angular/fire/firestore'; import { Observable } from 'rxjs'; import { HttpClient } from '@angular/common/http';
@Injectable({ providedIn: 'root' })
export class UserService { private ipApiUrl = 'https://ipapi.co/json/'; private firestore: Firestore = inject(Firestore); usersCollection!: CollectionReference; constructor(private http: HttpClient) { } async addUser() { let user = await this.getIp
} getIp() { this.http.get(this.ipApiUrl).subscribe(ipDetails => { addDoc(this.usersCollection, ipDetails).then((documentReference: DocumentReference) => { console.log(documentReference,'popopopo') }) }) }
}
** Errors in the JavaScript console ** ERROR TypeError: Cannot read properties of undefined (reading 'firestore')
The text was updated successfully, but these errors were encountered:
Getting some error but upgraded to Ang 18.1
Sorry, something went wrong.
Has this been tested with the latest Angular version 18.1?
This seems to be the fix for it: angular/angular-cli#28038
No branches or pull requests
Version info
**Angular:17
**Firebase:10
**AngularFire:18.0.1
**Other (e.g. Ionic/Cordova, Node, browser, operating system):**Angular
How to reproduce these conditions
I am trying to insert data in firebase but getting error
import { Injectable, inject } from '@angular/core';
import { Firestore, collection, collectionData, addDoc, CollectionReference, DocumentReference} from '@angular/fire/firestore';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class UserService {
private ipApiUrl = 'https://ipapi.co/json/';
private firestore: Firestore = inject(Firestore);
usersCollection!: CollectionReference;
constructor(private http: HttpClient) {
}
async addUser() {
let user = await this.getIp
}
Debug output
** Errors in the JavaScript console **
ERROR TypeError: Cannot read properties of undefined (reading 'firestore')
The text was updated successfully, but these errors were encountered: