Its my first time using Firebase so still trying to get the hang of things but I can't seem to write to the RealTime database. I have updated the rules to 'write'.
import { Injectable } from '@angular/core';
import { AngularFireDatabase } from '@angular/fire/compat/database';
@Injectable({
providedIn: 'root'
})
export class UserService {
constructor(private db : AngularFireDatabase) { }
save (user: firebase.default.User) {
this.db.object('/users/'+ user.uid).update({
name: user.displayName,
email: user.email
});
}
}
I am using google authentication and the User itself is created under the Authentication tab. Additionally I also monitored the network tab in chrome and there is no request to any database when the save function is called which leads me to assume that the database has been incorrectly set up .
Took a break, restarted my pc, opened VS code and served the project and somehow it started working. Sometimes the good old "switch off, switch on" does wonders.