angularfire2

How to Angularfire2 remove() by some key value

橙三吉。 提交于 2019-12-25 04:57:20
问题 I am trying to delete comments of a particular thread orderby some key(sid) value. eComments 0b4080bb4e686f003aaa340f8ed2e2a6 cid: "0b4080bb4e686f003aaa340f8ed2e2a6" comment: "Prison Break revolves around two brothers: one ..." createdAt: 1487250871623 rating: 0 sid: "c088239a29827946f932f73c9a1d495a" uid: "SFmtrI0ta5PsqYkgqZuJo2" updatedAt: 1487250871623 4bde9de83ac2bb6d06df9876c2294483addclose cid: "4bde9de83ac2bb6d06df9876c2294483" comment: "arrives at the jail, he meets the prison denize.

AngularFire Rxjs subscription - return nill results

可紊 提交于 2019-12-25 01:48:34
问题 I have two collections which I need to loop through, I start by geting the users groups, I then loop through each group and get the jobs associated with that group. This works perfectly, but the problem is that if there is no jobs the app stays in a loading state. Here is my code: this.fb .getUsersGroupsAsObservable(user.uid, groupType) // first get the users groups .subscribe(groups => { combineLatest( // for each group get the jobs belonging to that group groups.map(group => this.fb

Display Firebase Data on HTML Page

﹥>﹥吖頭↗ 提交于 2019-12-24 20:40:33
问题 I'm trying to display messages on a feed using the following template called feed.component.html <div class="feed"> <div *ngFor="let message of feed | async" class="message"> <app-messages [chatMessage]="message"></app-messages> </div> </div> I keep getting the following error, and am unable to display the messages I send to the Firebase Database on my html chat page. ERROR Error: InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe' I've also got my feed.component.ts file as follows:

Angular Firebase Firestore get document ID

孤者浪人 提交于 2019-12-24 19:36:35
问题 My Firebase Firestore database is like this: Collection:orders DocumentID: (autogenerated) Document: orderName: string Variables declared like this: orderCollection: AngularFirestoreCollection<Order> orders: Observable<Order[]> I am getting all 'orders' like this: orderCollection = this.afs.collection('orders'); orders = this.orderCollection.valueChanges(); I am then printing the orders like this: <tr *ngFor="let o of orders | async"> <td>{{o.orderName}}</td> <td><a (click)="editOrder(o.$key)

INTERNAL ASSERTION FAILED: AsyncQueue is already failed

十年热恋 提交于 2019-12-24 19:29:45
问题 I have used promise inside the subscribe/observable as shown below. But it gives errors. can you tell me how to construct or design the code properly here? async loginWithGoogle(): Promise<void> { const result = await this.afAuth.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider()); const userId: string = result.additionalUserInfo.profile.id; const userProfile: AngularFirestoreDocument<UserProfile> = this.fireStore.doc(`userProfile/${userId}`); const userProfiles:

Firebase filter with pagination

天大地大妈咪最大 提交于 2019-12-24 10:39:49
问题 I'm doing an opensource Yelp with Firebase + Angular. My database: { "reviews" : { "-L0f3Bdjk9aVFtVZYteC" : { "comment" : "my comment", "ownerID" : "Kug2pR1z3LMcZbusqfyNPCqlyHI2", "ownerName" : "MyName", "rating" : 2, "storeID" : "-L0e8Ua03XFG9k0zPmz-" }, "-L0f7eUGqenqAPC1liYj" : { "comment" : "me second comment", "ownerID" : "Kug2pR1z3LMcZbusqfyNPCqlyHI2", "ownerName" : "MyName", "rating" : 3, "storeID" : "-L0e8Ua03XFG9k0zPmz-" }, }, "stores" : { "-L0e8Ua03XFG9k0zPmz-" : { "description" :

Get array element in observable at particular index [Typescript]

风格不统一 提交于 2019-12-24 10:07:56
问题 I am running an ionic3 app with Angular4 and angularfire2-Firestore. How does one go about getting a single object from an Observable. I am looking to return in typescript. console.log(this.opportunity.title) // "Title1" In the code below I am using the getOpportunityByIndex() method with index as the parameter. I am getting the following output and I'm not sure what to do next. Observable {_isScalar: false, source: Observable, operator: MapOperator} operator:MapOperator {thisArg: undefined,

Ionic & AngularFire2 best practice for unsubscribing to observables

旧巷老猫 提交于 2019-12-24 09:01:24
问题 I have a multi-page Ionic-Angular phone app that uses AngularFire2 & Firestore. One of the things I really like about Firestore is offline persistence of data. My question revolves around this data persistence and best practices for unsubscribing to AngularFire2 stream observables. My home page is a list of events and when an event is selected the app routes to a single-event page with this specific event's details. Currently I subscribe to the single-event using AngularFire2 API based on the

Limiting the firebase equalTo query with the optional key parameter

こ雲淡風輕ζ 提交于 2019-12-24 07:28:11
问题 I have a feeling I may have the understanding of this feature wrong coming from the SQL background. The documentation is sparse and I haven't been able to find a good example or an explanation. I am looking for a clarification to the following from https://github.com/angular/angularfire2/blob/master/docs/4-querying-lists.md: 1 The Firebase SDK supports an optional key parameter for startAt, endAt, and equalTo when ordering by child, value, or priority. You can specify the key parameter using

AngularFire doesn't detect changes if persistence is enabled

随声附和 提交于 2019-12-24 01:24:56
问题 I'm using AngularFire and have the persistence for offline support enabled in my app.module.ts : imports: [ AngularFireModule.initializeApp(environment.firebase), AngularFirestoreModule.enablePersistence() ] When my application start, I retrieve the user using valueChanges() like the following: const doc: AngularFirestoreDocument<User> = this.myCollection.doc<User>(userId); doc.valueChanges().pipe(take(1)).subscribe((user: User) => { console.log(user); }, (err) => { console.err(err); });