Created
February 22, 2018 20:18
-
-
Save shafiqshams/5ef4c75f2c61c4087014c8b66a56cc67 to your computer and use it in GitHub Desktop.
Mouse Events Ionic 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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