Nativescript-angular: Question - Is there an on-release event for touch events in Nativescript Angular?

Created on 19 Dec 2016  路  3Comments  路  Source: NativeScript/nativescript-angular

The docs show how to use (touch) in the HTML to specify a touch event, but how do I fire a (release) event?

Thanks.

question

Most helpful comment

Hi @tskweres

For the touch event you have a property called action which returns up, down, move and cancel.

e.g.:

_page.xml_

    <FlexboxLayout (touch)="onTouch($event)">
        <Label class="h2" text="Test text'"></Label>
    </FlexboxLayout>

_page.ts_

import { TouchGestureEventData } from "ui/gestures";
export class ItemDetailComponent {
    onTouch(args: TouchGestureEventData) {
        console.log(args.action);
    }
}

All 3 comments

Hi @tskweres

For the touch event you have a property called action which returns up, down, move and cancel.

e.g.:

_page.xml_

    <FlexboxLayout (touch)="onTouch($event)">
        <Label class="h2" text="Test text'"></Label>
    </FlexboxLayout>

_page.ts_

import { TouchGestureEventData } from "ui/gestures";
export class ItemDetailComponent {
    onTouch(args: TouchGestureEventData) {
        console.log(args.action);
    }
}

works perfectly, thank you!

Thank you very much @NickIliev 鉂わ笍 This way I can finally self-implement RadListView item reorder cancellation event 馃槂

Was this page helpful?
0 / 5 - 0 ratings