To what: Conditionally call a function on pressing enter.
To how: By providing a second argument as a condition to call a function
To why: Because nesting forms within forms, sometimes you don't want to submit or calidate.
In your Angular project, run bower install --save pz-enter-key
to save the
module. Then, in your HTML, add:
<script src="/path/to/bower_components/pz-enter-key/dist/index.min.js"></script>
And nextly, in your Angular module, include pz.enterKey
as a dependency:
angular.module('my-app', ['pz.enterKey'])
And Lastly, add the '.needsclick' class for elements that you want to avoid using fastclick functionality.
<any pz-enter-key="[vm.function.toCall(), {{ ( condition } }} ]"></any>