Hello I am fairly new to the Angular framework so bear with me please. I have a feed/timeline made out of simple posts that contain text. That text is saved in Firebase. This is how it gets saved:
firestore = new FirebaseTSFirestore();
createItem(postInput: HTMLInputElement) {
let postMessage = postInput.value;
let postId = this.firestore.genDocId();
this.firestore.create(
{
path: ["Posts", postId],
data: {
postMessage: postMessage,
timestamp: FirebaseTSApp.getFirestoreTimestamp()
}
}
)
}
The names of documents inside the Posts folder are randomly generated through let postId = this.firestore.genDocId();. Each document is a post in my timeline.
Then I have a "trash bin" icon in my post html component, which I plan on using as a delete button.
<span><i class="fa fa-trash"></i></span>
This is how the list looks like: timeline
What I need is a way to delete the document to which that trash icon belongs to. I have searched the internet but have found little. How do I do it?
Thanks in advance.