Capture drag on mobile or mouse move events on pc

I’m building an application that connects to my smart TV in order to remote control it.

I just want to add an area where you can move your mouse (or move your finger) that updates the pointer coordinates in the TV.

I can’t find anything related to it with ionic 2. Any clues where to read documentation about it?


What is question? Get the move coordinates? Move event returns the event object with coordinates.

Hey @xr0master, sry If I didn’t explain myself.

In the Events doc I can’t find anything related to mouse events or any other event:

So, it’s not clear for me to which kind of event I need to subscribe in order to get touch/move coordinates.

1 Like

Ah )
Events there are EventEmitter. You no need it. You need use just the javascript events.

<div (move)="somethingMoved($event)"></div>
class MyComponent {
  somethingMoved(event) {

Update: Fixed my terrible English

Thanks for the reply :slight_smile:

That didn’t worked. It works for (click) but it is not working for (move)

  selector: 'tv-area',
  template: '<div (move)="test($event)" style="background-color: red;">foobar</div>'
export class TvAreaComponent {
  constructor() {}

  test(event) {

I made a mistake.


Uffff… now I understand what you meant at the beggining… I was thinking off the window…

This has to do with angular 2 managing events and not ionic. Sry, my bad when I got confused with Events api.


1 Like

Hey just wanted to chime in on this a bit.

So if you wanted to bind to an event in angular to, all you need to do is use the (eventName)

1 Like