0
Whoa, whoa, whoa, whoa, whoa, whoa, whoa, whoa, whoa, whoa, whoa, whoa, whoa, whoa, whoa, whoa? next, I’m doing a crud for the company where I work, but I’m not able to make it update automatically after I delete the line, being necessary I refresh manually in the browser, I ran a alert();
in function reloadTable()
just to test and see if it really was working and yes it is, Alert appears but still it does not perform the operation.. what can I have wrong there? I’m still starting with Angular. Follow my code below:
delete(row){
console.log(row);
this.cartService.delete(row.Id)
.then(data => this.reloadTable(true));
}
reloadTable(reload: boolean = false){
alert("test");
this.router.navigate(['../../'], { relativeTo: this.route, queryParams: { reload } });
}
The angular itself is already busy updating the table when you delete a row. However, apparently you are only deleting the line in the backend. An option is in the "reloadTable" function you search in the backend the updated values after deletion. Another option is in "delete(Row)" you remove the value of the variable that is shown in the table as well
– brenodiogo
The list of where you will remove is in the same?
– adventistaam
@adventistaam yes she is in the same
– Bruno Taletti
@brenodiogo in the case as I would to fetch this data in the backend using the angular?
– Bruno Taletti
Look I tried using the
this.router.navigate(['../../'], { relativeTo: this.route, queryParams: { reload } });
and I passed thenavigate
the route to the table link it even atulizes, but only the last line and from time to time still– Bruno Taletti