I want to execute a JavaScript code, let's say a simple alert() function, if a user clicks on element with a special class within my AngularJS application. If I were to use simple jQuery, I would do it like that:
$('.specialClass').on('click', function(){
alert('hi');
});
This is exactly what I have in main.js file that I have included in my index.html. I even have several $(document).on('click',... pieces of code there that do actually work. However, the $('.specialClass').on('click'... part does not work. I have no idea how to actually implement this as elements with class specialClass could be encountered all over the place in different views, controllers, directives, etc. basically everywhere in the app. Any ideas how to approach this problem?