Yatin Kapur
Yatin Kapur

Reputation: 23

@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.

Upvotes: 1

Views: 1187

Answers (1)

Vladyslav Yazykov
Vladyslav Yazykov

Reputation: 71

@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.

Upvotes: 1

Related Questions