I'm currently facing an issue with displaying checked data in an Array within my Angular application. Upon clicking the checkbox, I receive a true value, but unfortunately, the data does not display as it contains null values.
For reference, here is a link to the StackBlitz demo: https://stackblitz.com/edit/angular-ivy-kt2uag?file=src%2Fapp%2Fapp.component.ts
Code snippet:
component.ts
The following functions are being utilized:
fetchSelectedItems() {
this.selectedItemsList = this.checkboxesDataList.filter((value, index) => {
console.log(value.selected);
return value.selected === true;
});
}
fetchCheckedIDs() {
this.checkedIDs = [];
this.checkboxesDataList.forEach((value, index) => {
if ((value.selected)) {
this.checkedIDs.push(value.code);
}
});
}