import { Component } from "@angular/core" ; import { GridLayout } from "@nativescript/core" ; import { PinchGestureEventData } from "@nativescript/core" ; let startScale = 1 ; @ Component ( { moduleId : module . id , templateUrl : "./pinch.component.html" } ) export class PinchExampleComponent { public scale : number ; public state : number ; onPinch ( args ) { console . log ( "Object that triggered the event: " + args . object ) ; console . log ( "View that triggered the event: " + args . view ) ; console . log ( "Event name: " + args . eventName ) ; console . log ( "Pinch scale: " + args . scale + " state: " + args . state ) ; this . scale = args . scale ; this . state = args . state ; let grid = < GridLayout > args . object ; if ( args . scale && args . scale !== 1 ) { let newScale = startScale * args . scale ; grid . scaleX = newScale ; grid . scaleY = newScale ; } } }