Posts

Showing posts with the label angularfire2

AngularFireDatabase Does not retrieve data

AngularFireDatabase Does not retrieve data Whenever I use afDB.list('/path') method, I get the following: console.log(this.items); and I have this example as my firebase database: listings file surprisingly, editing the data works perfectly fine (e.g. remove(), push(),... etc.), but I can't seem to be able to retrieve it; however, I can access it. I thought it might be a rules issue, yet, my rules are fine: firebase Rules this is the portion of the code that I'm having trouble with: import { Component } from '@angular/core'; import { NavController } from 'ionic-angular'; import { AngularFireAuth } from 'angularfire2/auth'; import { FirebaseProvider } from '../../providers/firebase/firebase'; import { AngularFireDatabase } from 'angularfire2/database'; import { Observable } from 'rxjs/Observable'; import * as firebase from 'firebase/app'; //import { ListingDetailsPage } from '../listing-details/listing-details...

angularfire2 collection querying with endAt wont give result

angularfire2 collection querying with endAt wont give result I am trying to querying date range at firebase by using startAt() and endAt() methods.(Angular6) For date picking i use angular material MatDatepicker module. q_startDate; q_endDate; getStartDate(event: MatDatepickerInputEvent<Date>) { this.q_startDate = event.value.toISOString();} I defined q_startDate and q_endDate veriables and pushed data with getStartDate and getEndDate methods. const myCollection = this.afs.collection<objInterface>('collection_name', ref=> { let query: firestore.CollectionReference | firestore.Query = ref; query = query.orderBy('date_field', 'desc'); query = query.startAt(this.q_startDate); query = query.endAt(this.q_endDate); return query; }); In this query when i comment query = query.endAt(this.q_endDate); it works. How can i fix this issue, i want to include query also q_endDate? By click...