Let's say, we were trying to delete an item from the list using the web api.We had created a child component named as remove-item using parameters - item and onRemove.On click of a item,we would like to trigger the callback function to the parent component.As per the code,onRemove is not getting called after deleting the item.Can someone help us figure out the error and provide us the right solution with an illustration.
remove.component.js
-------------------
this.RemoveItem = function (index) {
var promise = productList.removeItem(parseInt(this.id));
promise.then(function (response) {
console.log("An item has been deleted");
this.items=response.data;
}, function (error) {
console.log("An error has occurred while deleting the item:", this.id);
});
this.onRemove({
$index: this.items
});
}