Get checkbox values and display them to another page


#1

I have checkboxes that you can select one or more of with this function:

//Adds the checkedbox to the array and check if you unchecked it
addCheckbox(event, checkbox : String) {
if ( event.checked ) {
this.checked.push(checkbox);
} else {
let index = this.removeCheckedFromArray(checkbox);
this.checked.splice(index,1);
}
}

//Removes checkbox from array when you uncheck it
removeCheckedFromArray(checkbox : String) {
  return this.checked.findIndex((category)=>{
    return category === checkbox;
  })
}

//Empties array with checkedboxes
emptyCheckedArray() {
  this.checked = [];
}

getCheckedBoxes() {
console.log(this.checked);
}

How can I add another function to getCheckedBoxes so that when the button is clicked, the checked boxes information would be displayed to About Page?