Skip to content

Instantly share code, notes, and snippets.

@shafiqshams
Created February 22, 2018 20:18
Show Gist options
  • Save shafiqshams/5ef4c75f2c61c4087014c8b66a56cc67 to your computer and use it in GitHub Desktop.
Save shafiqshams/5ef4c75f2c61c4087014c8b66a56cc67 to your computer and use it in GitHub Desktop.
Mouse Events Ionic 2
import { Component } from '@angular/core';
@Component({
selector:'sandbox',
template:`
<h1>Hello World</h1>
<button id="btn" (click)="fireEvent($event)">Click Event</button>
<br>
<button id="btn" (mouseover)="fireEvent($event)">Mouseover Event</button>
<br>
<button id="btn" (mousedown)="fireEvent($event)">Mousedown Event</button>
<br>
<button id="btn" (mouseup)="fireEvent($event)">Mouseup Event</button>
<br>
<button id="btn" (dblclick)="fireEvent($event)">Double Click Event</button>
<br>
<button id="btn" (drag)="fireEvent($event)">Drag Event</button>
<br>
<button id="btn" (dragover)="fireEvent($event)">Drag Over Event</button>
`
})
export class SandboxComponent{
fireEvent(e){
//console.log('Button Clicked');
//console.log(greeting);
console.log(e.type);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment