简体   繁体   中英

@HostListener('tap') in Nativescript Angular

Is there any way we can listen to @HostListener('tap') or any gesture in NativeScript Angular Application?

I am trying to develop a Directive, scenario for which is when user open a custom modal/component and tap anywhere outside component will close the the modal/component.

@HostListener('tap', ['$event']) onTap(event: TapGestureEventData) {
  // do your stuff here
}

In my case, I was wondering how to pass gesture event data to the handler. Found the answer here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM