I want to monitor the click of user in angular application, rather dont want to mannual configure for each click event, I want some thing at higher level that tells me each time where user clicked in application.
Asked
Active
Viewed 326 times
-2
-
`window.addEventListener('click, callback)` is all you need – Ivan Mar 03 '19 at 00:48
-
1Keep in mind angular is just fancy JavaScript. Anything you can do in JS is also available to you. – theMayer Mar 03 '19 at 00:48
-
@Lends how do i know where user click, on which DOM – Tarun Mittal Mar 03 '19 at 00:55
-
@HiteshGarg you have arguments in your callback function. The first one is the `event`. You can get a lot of info from it. – Ivan Mar 03 '19 at 01:00
1 Answers
0
@HostListener('click') onClick()
might be just what you are looking for...
You can add it to your component and it will be called on each click event

Francisco Santorelli
- 1,243
- 8
- 13