In Native-script app, on tapping a button the function is not working(not called). When I make any change or even write console.log('hi') inside that function then it start works. But when I go to another screen and come back to the previous screen and tap the button again, it stops working again. I don't understand what's the issue is ?
This is the html code :
<Button class="alarms-btn" text="Alarms" (tap)="onClickActiveAlarm()"></Button>
This is .ts code :
public onClickActiveAlarm() {
if (_.size(this.alarms) === 0) {
this.snackWarn('No Alarms')
return
}
this.routerExtensions.navigate(['/', alarms])
}