I am deleting the object from my database using delete button made in angular 13, but this does not delete it instantly from frontend

Aakash Singh

i need to delete the object real-time from frontend as well as backend my, The object gets deleted from the backend instantly but it do not reflects in the frontend till the page is refreshed

//delete component

deleteStory(id : string){
  console.log(id)
  this.storyapiService.deleteStory(id).subscribe();
  

  }

service.ts

deleteStory(id: string): Observable<number>{

     return this.http.delete<number>(this.API_URL +id);

  }

//html

<button class="btn btn-primary" (click)="deleteStory(story.id)" style="margin-left:5px">Delete </button>

José Ignacio Duque

Try to get data again once you delete the element to refresh the current view.

Hope it works!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

I need to Delete any object from my DRF / django connected database through angular 13

delete button delete record from the database but not from the frontend

Why is my delete button not deleting my database object? Django

I'am not able to delete information from my database

SQLALCHEMY deleting Association Object does not delete it from the parent and child

DELETE query not deleting from database table

OnItemLongClick to delete from ListView and database not deleting

i'm having trouble with my django code while i deleting the data from the table form on click of the delete button

In Angular I need to delete item from my view page but not from Firebase database. Any suggestions for this?

I am not able to delete my folder from Trash

i am not able to delete android studio completely from my device

Deleting a file from storage does not delete an image

How to delete a node from a tree. I am trying to delete the node from the function but still it is getting print even after deleting

Angular delete a record from the database

Does deleting data from a database (using actual delete SQL query) cause huge problems in re-indexing of table data?

I am using this sql statement to delete the total record from a table

How to delete listview item from database using button?

Does deleting a file from my computer also delete it from Ubuntu One?

How to delete a kubernetes cluster using kops without deleting EBS persistent volume that I used for my database?

Delete from database using javascript

How to delete value from the database which is entered into my textView after pressing delete button?

how to delete a file or a photo from the folder when deleting it from database?

how to delete multiple photos from the folder when deleting it from database?

How to delete an object from a ListView using a button in the ListViewItem?

How can I delete few files from a directory at restart of my OS before getting logged ? I am using ubuntu 19.10?

Trying to delete from database using HTTPDELETE does nothing

How to delete instantly a await message from the channel

What am I missing from this DELETE statement

Delete row from database with a button in table (PHP)