Hi,
I want to use a function when a button is taped. The button is part of a popup and the function should change the value of the variable “count” to 0.
This is my code (.ts):
count:number=5;
showConfirm() {
let confirm = this.alertCtrl.create({
title: 'Reset Counting?',
message: `Reset: Resets Count Variable`,
buttons: [
{
text: 'Reset',
onTap: reset(),
handler: () => {
console.log('Reset Clicked');
}
},
]
});
confirm.present();
}
reset(){
this.count=0;
}
If you have any suggestions, especially code, I would be very thankfully.
Greetings,
Robert