Reputation: 865
I have the following method, which changes a variable from false to true in a grid, what I need is to save that variable and refresh the grid so that when the page is refreshed, the reflected changes are seen.
onClickBloquear(event: any) {
if (event.dataItem !== undefined) {
const id = event.dataItem.id;
this.service.bloquear(id);
}
}
Upvotes: 0
Views: 141
Reputation: 18085
Angular does not store anything on a compnent.
If you want to save states, variables etc. you need an angular service which can be used to store data, and it can be injected to any of your components instances.
You provided a really small code, and hard to guess what your exact problem is, but something this should solve it:
Upvotes: 1