I'm new to angular and failing to understand why should i use angular ng-click
over jQuery event listeners? Since the best practice is to use only one of them in my App (according to this highly up voted answer) Isn't there any elegant solution in angular to listen to events such as in jquery?
jQuery
<span>Box 1</span>
<span>Box 2</span>
<span>Box 3</span>
$("span").on('click',function() {
// do something
});
Angular
<span ng-click="doSomething();">Box 1</span>
<span ng-click="doSomething();">Box 2</span>
<span ng-click="doSomething();">Box 3</span>
$scope.doSomething = function(){
// do something
};
What will happen if i'll need to change the function name, or remove it completely, in angular i'll have to go over the entire code and remove the ng-clicks.