Pleasea refer to Link
<form ng-submit="foo()" handle-phone-submit> <input type="text" ng-model="query" name="query" /> <button type="submit">OK</button> </form
angular.module('Foobar', []) .directive('handlePhoneSubmit', function () { return function (scope, element, attr) { var textFields = $(element).children('input[type=text]'); $(element).submit(function() { console.log('form was submitted'); textFields.blur();
document.acvtiveElement.blur(); }); }; });