Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Last active April 5, 2017 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/fb9297ffc43a21b02ea00a293207c63f to your computer and use it in GitHub Desktop.
Save matthieu-D/fb9297ffc43a21b02ea00a293207c63f to your computer and use it in GitHub Desktop.
import {HostListener, Component} from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
@HostListener('document:click', ['$event'])
onDocumentClicked(ev) {
console.log('clicked', ev);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment