This question recently came up in StackOverflow, and I thought I'd cross post my answer because I think I nailed this one.
The poster wanted to listen for an event in Angular. In the bulk of cases, I would do this in your HTML:
And this inside your component method:
It is simple, well documented, and Angular already 'wraps' the bulk of events dispatched up from your HTML page.
However, the poster really wanted to access the eventsin TypeScript. This is doable, but becomes a bit more complex.
First, add a #value to the HTML element in your HTML Template:
The #MyButton syntax allows you to reference the child in code using the @ViewChild metadata:
Then you should be able to call the methods on the native element to access the event:
If at all possible, I try to avoid drilling down into the ElementRef like this. I think I did it once when I created a reusable toast style component for a client, but for normal development I stick with the event directives.