How to call function inside dynamically checkbox in ionic3?
i have to call the function if user is select any single checkbox how to do this?
// Object with options used to create the alert
var options = {
title: 'Select subcategory',
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
},
{
text: 'Ok',
handler: data => {
this._createUsersCategory();
}
}
]
};
options.inputs = [];
//Here we will generate dynamically check-box
for(let i=0; i< this.selectedSubcategoryArray.length; i++) {
let subCategoryName = this.selectedSubcategoryArray[i].subCategoryName;
options.inputs.push({
value: subCategoryName,
label: subCategoryName,
type: 'checkbox'
});
}