// round page
newRound() {
console.log('new round ', this.round);
this.you.score = +this.score;
this.round++;
console.log('THE PLAYERS -> ', this.players);
this.afStore.collection('matches').doc(this.gameRoom).collection('match').doc(`${this.round}`).set({players: this.players, round: this.round}).then(() => {
console.log('UPDATED GAME');
});
this.router.navigate(['/events/tab2/' + this.gameRoom]);
}
// Tab page that goes to the round page
// NOTE: this is for the next page, round 1,2,3,4 etc...
theRound() {
this.newRound++;
console.log('this is the new round ', this.newRound);
this.afStore.collection('matches').doc(this.gameRoom).collection('match').doc(`${this.newRound}`).set({players: this.players, round: this.newRound});
this.afStore.collection('matches').doc(this.gameRoom).collection('match').doc(`${this.newRound}`).valueChanges().subscribe((v: any) => {
this.router.navigate(['/events/tab2/' + this.gameRoom + '/' + v.round]);
console.log('data returned from firebase ', v);
});
}
Привет всем! У меня проблема. Я пытаюсь обновить указанную коллекцию c в firebase, но она создает коллекцию, но не обновляет "счет", как только я нажал значение на круглой странице. Также создается вторая коллекция с обновленным счетом. Любая помощь будет высоко ценится.