I am currently working on a front-end application that is connected to a back-end system. Everything seems to be functioning well, but I have encountered an issue where deleting a div with a post causes it to disappear without any visual effect. I would like to add some animation or effects to make it clear to the user that the post has been deleted. Although I am new to Angular and this is my first front-end app, I believe it should be a simple task to accomplish.
Below is the code for the method used to delete a post:
deletePost1(id:number){
this.messageService.delete(id).subscribe(res => {
this.messages = this.messages.filter(item => item.id !== id);
console.log('Post deleted successfully!');
})
}
And here is the corresponding method in the service:
delete(id: number) {
return this.httpClient.delete(this.apiURL + 'api/message/' + id, this.httpOptions)
.pipe(
catchError(this.errorHandler)
)
}