import { Component } from "@angular/core" ; import { Button , EventData } from "@nativescript/core" ; @ Component ( { moduleId : module . id , templateUrl : "./usage.component.html" } ) export class ButtonUsageComponent { public counter : number = 0 ; onTap ( args ) { let button = args . object as Button ; this . counter ++ ; alert ( "Tapped " + this . counter + " times!" ) ; } }