108
rated 0 times
[
110]
[
2]
/ answers: 1 / hits: 155361
/ 11 Years ago, mon, january 13, 2014, 12:00:00
I know that I can get access to the click event from ng-click
if I pass in the $event
object like so:
<button ng-click=myFunction($event)>Give me the $event</button>
<script>
function myFunction (event) {
typeof event !== undefined // true
}
</script>
It's a little bit annoying having to pass $event
explicitly every time. Is it possible to set ng-click
to somehow pass it to the function by default?
More From » angularjs