My Create method is like this
create(user: User, uuid: string): Promise<void> {
return this.db.object('/users/${uuid}')
.set(user)
.catch(this.handlePromiseError);
}
And my User class is like this
export class User {
public $key: string;
constructor(
public name: string,
public username: string,
public email: string,
public photo: string
) {}
}
But when I write to the firebase, the id goes undefined and when I write another data it overlaps the first one and exits.