Open SlyEzo opened 3 years ago
Update : I found that this code works, though the subscription on the AngularFirelist list notified once for each question removed :
removeCategoryQuestions(currentCategory: string) {
const categoryEvaluations = (this.categoriesEvaluations[currentCategory] ?? []) as Evaluation[];
categoryEvaluations
.map(evaluation => evaluation.key)
.filter(evaluationKey => evaluationKey != null)
.forEach(evaluationKey => this.evaluationsRef.remove(evaluationKey));
}
Version info
Angular: 12.1.1
Firebase: 8.7.0
AngularFire: 6.1.5
Other (e.g. Ionic/Cordova, Node, browser, operating system): N/A
How to reproduce these conditions
Steps to set up and reproduce
Example of code
The following piece of code removes all objects regardless of the category property :
However, this piece of code displays only the objects having the right category value :
Expected behavior
.remove()
called on a filteredAngularFireList
should remove only the filtered objects.Actual behavior
.remove()
called on a filteredAngularFireList
removes all objects, regardless of the filter applied.