angularfire2

Angularfire2.5 Real Time Database with angular material autocomplete

倖福魔咒の 提交于 2019-12-24 00:52:41
问题 I am trying to use the angular material autocomplete input field with angularfire2 v5. I have some difficulties adapting the shown example: https://material.angular.io/components/autocomplete/examples to a firebase list. It seems that the functions used in the example can't work with an observable input: The following code : // FROM COMPOSERS.SERVICE.TS constructor(private db: AngularFireDatabase) { this.membersRef = db.list('/members'); this.members = this.membersRef.valueChanges(); }

AngularFire2 initializing app gives error

半世苍凉 提交于 2019-12-24 00:39:46
问题 I am trying to initialize AngularFire2 in my Angular2 application, but I am getting the following error. ERROR in ./src/app/firebase/index.ts Module build failed: Error: /Users/jaruesink/Documents/Projects/buckets/src/app/firebase/index.ts (16,17): Return type of exported function has or is using name 'ModuleWithProviders' from external module "/Users/jaruesink/Documents/Projects/buckets/node_modules/@angular/core/src/metadata/ng_module" but cannot be named.) at _checkDiagnostics (/Users

Property 'update' does not exist on type 'Observable<{}>'. Firebase 5 AngularFire2 5

本秂侑毒 提交于 2019-12-23 12:29:08
问题 I am trying to create/update shopping-cart in firebase. I am using a service that has functions that add the localStorage ID to firebase and It add's the quantity in shopping-cart if the product already exist otherwise it created new one. The error occurred in console TypeError: Cannot read property 'quantity' of null and I also got error on compilation in shopping-cart service.ts: Property 'update' does not exist on type 'Observable<{}>'. Property 'quantity' does not exist on type '{}' The

Firebase + Ionic3 Error: disallowed_useragent

只谈情不闲聊 提交于 2019-12-23 09:29:53
问题 There are a couple of other questions/answers on this topic, but they were not using Firebase with Ionic. I just switched to the new Ionic View and right now today, my app in the old Ionic View works while the new Ionic View gives me this well known error: 403 Error - Thats an error. Error: disallowed_useragent his user-agent is not permitted to make an OAuth authorization request to Google as it is classified as an embedded user-agent (also known as a web-view). blah blah blah In my code I

What should I use instead of toPromise() when using await on an Observable?

 ̄綄美尐妖づ 提交于 2019-12-23 09:14:55
问题 This page says "toPromise has been deprecated! (RxJS 5.5+)" but I've been using it lately with AngularFire2 (when I only want one result) like this: const foo = await this.afs.doc(`docPath`).valueChanges().toPromise(); Should I not be doing this? If not, what is the await alternative? UPDATE: After the answer below I've changed this: const foo = await this.afs.doc(`docPath`).valueChanges().toPromise(); ...to this: const foo = await (new Promise(resolve => this.afs.doc(`docPath`).valueChanges(

ngFor not displaying arrays

泪湿孤枕 提交于 2019-12-23 05:13:23
问题 I have a search service : getErros(start, end): FirebaseListObservable<any>{ this.hey = Rx.Observable.combineLatest( this.db.list('/erros/geral',{ query: { orderByChild: 'titulo', limitToFirst:10, startAt: start, endAt: end } }), this.db.list('/erros/utilsst',{ query: { orderByChild: 'titulo', limitToFirst:10, startAt: start, endAt: end } }), this.db.list('/erros/utilfac',{ query: { orderByChild: 'titulo', limitToFirst:10, startAt: start, endAt: end } }), this.db.list('/erros/utilatas',{

Integrate mat-table with AngularFirestore

你说的曾经没有我的故事 提交于 2019-12-23 03:54:09
问题 I would like to integrate mat-table from https://material.angular.io/ with angularfire2/firestore https://github.com/angular/angularfire2, some idea, I am very lost best regard 回答1: This is how you do it for simple table. In your html file put this. <mat-table [dataSource]="myData"> <ng-container matColumnDef="name"> <mat-header-cell *matHeaderCellDef>name</mat-header-cell> <mat-cell *matCellDef="let element"> {{element.name}} </mat-cell> </ng-container> <ng-container matColumnDef=

ngOnChange not storing previousValue property

我的梦境 提交于 2019-12-23 02:28:28
问题 [Angular2 @ RC4] [angularfire2 @ 2.0.0-beta.2] Inside my child component I cannot get changes['posX'].previousValue to store anything. Snippet from parent html: //inside *ngfor loop [posX]='coord.position_x | calculateX:395' [posY]='coord.position_y | calculateY:380' Snippet from Child component: export class childComponent implements OnChanges { @Input() posX: number; //updated via firebase database from parant @Input() posY: number; //updated via firebase database from parant ngOnChanges

How to send email verification code to user email in firebase

僤鯓⒐⒋嵵緔 提交于 2019-12-23 02:21:03
问题 I want to send email verification code to user's email using firebase authentication. I am using (sendEmailVerification) method but firebase sends a verification link to user's email. Is it possible to send verification code to user's email if yes then how it can be done? I am using Angular 4 and for firebase angularfire2 Thanks. 回答1: If don´t want to use the solution provided by firebase, you have to handle all the process yourself and then update the user emailVerified data to true . The

Using pure Observable vs array (from subscribe)

雨燕双飞 提交于 2019-12-22 12:59:32
问题 I was wondering about best practices regard using pure observable vs subscribe to an observable and use an array. option 1 - "pure observable" this.schools = this.angularFire.database.list('schools') and then in the HTML use async pipe (and rxjs operators for handling the data) option 2 - "subscribe to array" this.angularFire.database.list('schools').subscribe (response => this.schools=response) and then treat it as a normal array. 回答1: As olsn pointed out in the comments, it is always more