Hi there! I'm still getting the hang of the Angular framework, so please bear with me. Currently, I have a feed or timeline consisting of simple posts that contain text. This text is stored in Firebase using the following method:
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 Posts folder contains documents with randomly generated names achieved through
let postId = this.firestore.genDocId();
. Each document represents a post on my timeline.
I also have a "trash bin" icon within my post HTML component which will serve as a delete button.
<span><i class="fa fa-trash"></i></span>
Here's an example of how the list appears: timeline
My question is, how can I delete the document associated with the trash icon? I've searched online but haven't found much information. Any guidance on how to achieve this would be greatly appreciated.
Thanks in advance!