#Update data after deleting item with *ngFor | async

13 messages · Page 1 of 1 (latest)

hallow geode
#

sorry if my English isn't the best

frail swan
#

and <td ...> ????

hallow geode
#

there's obviously a td with a button that executes the delete user by id method

#

but nevermind, I think I found a way to do it

frail swan
#

onDelete(id: number) { ... code to remove into array... manipulate items }

#

don't use | async because you need to manipulate the data directly (remove item)

#
items: any;

.....subscribe((data: any) => items = data);

*ngFor to items

#

for the good practices, you have to rename well the names of the variables and to use the typing (avoid to use : any)

winged ferry
#

You can use async + trackBy if you want to manipulate it

winged ferry
#

And that subject will next the newest array

maiden vessel