With jquery we can do something like
$(.some-class).click(function() { alert('Hello!!');});
With Angular2 / Angular4 , I know we can have
(click)="alert('Hello!!');"
but this mean, I have to do it for each element.
Is there a way to assign the same method to all the elements with the same class?
EDIT: I don't want to select the elements by class rather, have the same function binded to the click event for all elements with the same class.