import { Component } from "@angular/core" ; import { GridLayout } from "@nativescript/core" ; import { RotationGestureEventData } from "@nativescript/core" ; @ Component ( { moduleId : module . id , templateUrl : "./rotation.component.html" } ) export class RotationExampleComponent { public angle : number ; public state : number ; onRotation ( 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 ( "Rotate angle: " + args . rotation + " state: " + args . state ) ; this . angle = args . rotation ; this . state = args . state ; if ( this . state === 3 ) { let grid = < GridLayout > args . object ; grid . rotate = 0 ; grid . animate ( { rotate : this . angle , duration : 200 } ) ; } } }