angularfire2

Angularfire2 Firestore Update same field in multiple documents

馋奶兔 提交于 2019-12-11 16:04:42
问题 I have a profile table and a jobs table stored on Firebase Firestore. I am creating an Angular 5 web site. To save on network calls i added the users profile name to each job document. (Not sure if firestore has table linking). So when the user updates him name, I also have to update their job documents (not many). I can get a collection of jobs with the right user id. But i cannot figure out how to iterate through the list and update the one field without using an Observable (one time call).

AngularFire2 group data into array of objects Firestore collection

╄→гoц情女王★ 提交于 2019-12-11 15:52:33
问题 I have a collection called addons . The collection contains fields namely, name , desc , price and type . I am straight away fetching the data with this.afs.collection<AddOns>('addons'); which returns AngularFirestoreCollection<AddOns> . I have below class file defined for data from Firestore Collection. AddOns.ts export class AddOns{ name?: string; desc?: string; price?: number; type?: string; } export class AddOnId extends AddOns{ aid?: string; } Since I need metadata too from that

Access multiple Realtime Databases of the same firebase app project

好久不见. 提交于 2019-12-11 15:46:15
问题 I found some explanations about connecting multiple databases from separate app projects with angularfire2. But I would like to access databases within the same project . The documentation stated: // Get the default database instance for an app var database = firebase.database(); // Get a secondary database instance by URL var database = firebase.database('https://testapp-1234.firebaseio.com'); How can I do this with angularfire2? 回答1: I know you got a working answer here : https://github.com

RXjs groupBy - Group AngularFire Firestore collection

拜拜、爱过 提交于 2019-12-11 15:29:40
问题 I'm trying to group a AngularFire Firestore Collection (Observable[]) by a field, say userId . I have a collection of items, each with varying userId values, and I need to group them into a multidimensional array. So, convert.. [ {userID:1, color:'blue' }, {userId:2, color:'green'}, {userId:1, color:'orange'} ] into [ [ {userID:1, color:'blue' }, {userId:1, color:'orange'} ], [ {userId:2, color:'green'} ] ] I'm totally new to RxJs, I get how the groupBy operator works when making an

Firebase / angularFire2 v5 authentication issue on mobile

这一生的挚爱 提交于 2019-12-11 14:16:31
问题 I am creating a PWA and trying to use firebase/angularfire2 v5 to authenticate my users against Facebook or Google (I followed a tutorial that is present in angularfire2 github site). When I use the application in a "normal" browser in a desktop or mobile device everything works fine. The problem starts when I install the application in a mobile device and try to use the authentication (in the manifest.json the property display is set to "standalone"). I end up in a blank page. I tried to

Cannot access firebaseObjectObservable outside of set

别说谁变了你拦得住时间么 提交于 2019-12-11 09:25:21
问题 First, this is an Angular2 app. I am just starting out building with Angular2 and Firebase. I am using AngularFire2 as well. I know that my service is working, because I can print out the blog.title just fine right after subscribing. But that is the only place I can get access to the results. Everywhere else it is giving me an undefined error. Whether I use it in the template with {{}} or in the class, I get the same same result. I am not sure what I am doing wrong. I am also new to

access data from document referenced inside firestore collection

我只是一个虾纸丫 提交于 2019-12-11 08:48:42
问题 I have a collection inside firestore database that consists of several data fields and references. Structure looks like this: firstCollection document sample { name: 'parent', //more fields, second: //reference to document from second collection } secondCollection referenced document sample { title: 'document title', more: 3456, etc: '...' } I have angular application with angularfire2 library included. In one of my html files I need to print data from the first collection including some

How do I remove a user by key or value?

删除回忆录丶 提交于 2019-12-11 08:38:12
问题 I have a structure in my Firebase database like this: --users --v7BwBnUBqJMXCtoOHYE51jXCwhY2: uid --etc The users 'table' gets populated when a user gets authenticated like this: loginFb() { this.af.auth.login({ provider: AuthProviders.Facebook, method: AuthMethods.Popup, }).then( (user) => { this.userOnline(user.uid, 'uid'); this.router.navigate(['/members']); }).catch( (err) => { this.error = err; }) } userOnline(uid, value) { const users = this.af.database.object('/users'); users.update({

Rerouting angular 5 app with AngularFireAuth

有些话、适合烂在心里 提交于 2019-12-11 08:37:19
问题 I got the simple authentication working with AngularFireAuth but now my routing doesn't work anymore the console.logs show that the 'test' comes before the 'Nice it worked', so what is wrong? (this is mainly just the routing guard out of the documentation) auth-service @Injectable() export class AuthService { user: Observable<firebase.User>; constructor(private firebaseAuth: AngularFireAuth){ this.user = firebaseAuth.authState; } isLoggedIn = false; login(email: string, password: string):

Firebase: approach to storing room passwords

泪湿孤枕 提交于 2019-12-11 08:06:24
问题 I'm building a web application with Firebase and Angular5. I want to make possible to create/join private rooms (protected by password). Currently I am at the stage of designing the database and can't really see how I can check user entering the correct room password without actually retrieving it from the firebase database (thus making it completely insecure). Should I employ cloud functions for that matter. Or can it be done directly with firebase and I'm missing something? 回答1: You can do