With no jQuery dependency!
Helpful for ASP.NET Webforms sites using Angular1.* since nested
<form>
tags aren't allowed.
Helpful with <ng-form>
tags since they don't automatically handle Enter keys for submitting the form.
This can also be used anywhere to simply run a specific function on the scope that's passed into the attribute.
Check out demo.html to see it in action
<ng-form>
<!-- some inputs -->
<button type="submit"
ng-click="vmDemo.submitThisForm()">
Submit Button
</button>
</ng-form>
<ng-form ng-submit="vmDemo.submitThisForm()">
<!-- some inputs -->
<button type="submit">
Submit Button
</button>
</ng-form>
<div on-enter="vmDemo.submitThisForm()">
<!-- some inputs -->
<button type="submit"
ng-click="vmDemo.submitThisForm()">
SAVE
</button>
</div>