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?