Skip to content
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

Unable to query database from Angular application. #108

Open
JoshWilliams92 opened this issue Mar 21, 2020 · 1 comment
Open

Unable to query database from Angular application. #108

JoshWilliams92 opened this issue Mar 21, 2020 · 1 comment

Comments

@JoshWilliams92
Copy link

Hello,
I was following the tutorial but cannot seem to query the dataset./
It must also be noted that you cannot save the data as an object type anymore in firestore so I saved the data as a geo-point.

I am using the following two options:
Option 1)

I declare the following in the ngOnInit lifecycle hook:

"const center = this.geo.point(51.5249949, -0.7466908);
this.points = this.radius.pipe(
switchMap(r => {
return this.geo.query('positions').within(center, r, field)
}))"

The following error appears in the chrome console log

ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'GeoPoint' of undefined
TypeError: Cannot read property 'GeoPoint' of undefined

Option 2)

I found the following github repo which referenced the error message above:
angular/angularfire#1604

I declare the following in the ngOnInit lifecycle hook:

"const center = new firestore.GeoPoint(51.5249949, -0.7466908)
this.points = this.radius.pipe(
switchMap(r => {
return this.geo.query('positions').within(center, r, field)
}))"

The following error message appears under the center parameter in the within():

"Argument of type 'GeoPoint' is not assignable to parameter of type 'FirePoint'
Type 'GeoPoint' is missing the following properties from type 'FirePoint': geopoint, geohash"

@jasonc624
Copy link

Yes im having this same issue since upgrading angular/fire i think they no longer export it in the new version and geofirex needs to account for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants