concept tap event in category nativescript
appears as: tap event, tap event

This is an excerpt from Manning's book NativeScript in Action.
You may have also noticed the button element has an additional property:
tap=”onTap”. The tap property of the Button element is an event that is raised by the button; as you may have guessed the button raises an event named tap when the button is tapped. You can handle the tap event by setting the value of the tap property to the name of a function in your corresponding JavaScript file.
Add a tap event and event handler to the text field, navigating to the birth date picker modal page when tapped. Pass in a close callback function the modal page will call when it is closed to pass back data to the update page.
Listing 11.26 The scrapbook update page handling the Done button’s tap event
<ListView class="list-group" items="{{ pages }}" itemTap="onItemTap"> <ListView.itemTemplate> <StackLayout orientation="horizontal" class="{{ isActive ? 'list-group-item active' : #1 'list-group-item' }}"> #1 <Image class="thumb img-circle" src="{{ image }}" /> <Label class="list-group-item-text" text="{{ title, (title === null || title === undefined ? 'New' : title + '\'s') + ' Scrapbook Page' }}" style="width: 100%" /> </StackLayout> </ListView.itemTemplate> </ListView> #1 When the isActive property is true, style the list item with the active class