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?
Best,
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: http://ionicframework.com/docs/v2/api/util/Events/
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.
Something…
<div (move)="somethingMoved($event)"></div>
@Component(...)
class MyComponent {
somethingMoved(event) {
console.log(event);
}
}
Update: Fixed my terrible English
Thanks for the reply 
That didn’t worked. It works for (click)
but it is not working for (move)
@Component({
selector: 'tv-area',
template: '<div (move)="test($event)" style="background-color: red;">foobar</div>'
})
export class TvAreaComponent {
constructor() {}
test(event) {
console.log(event);
}
}
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.
Thanks,
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