diff options
| author | Wesley Cho | 2013-05-23 11:22:55 -0400 | 
|---|---|---|
| committer | Igor Minar | 2013-07-11 17:27:36 -0700 | 
| commit | b0d5f062e316370c7ac57cfd628d085015a8187d (patch) | |
| tree | eb3391aafa990e0ea04ea42804f7b97111fb8ad2 /src | |
| parent | 2c0753225a506185bf8b09b344e7615957009f02 (diff) | |
| download | angular.js-b0d5f062e316370c7ac57cfd628d085015a8187d.tar.bz2 | |
fix(ngSubmit): expose $event to ngSubmit callback
Diffstat (limited to 'src')
| -rw-r--r-- | src/AngularPublic.js | 1 | ||||
| -rw-r--r-- | src/ng/directive/ngEventDirs.js | 57 | 
2 files changed, 50 insertions, 8 deletions
diff --git a/src/AngularPublic.js b/src/AngularPublic.js index d281a2d5..2ecaee84 100644 --- a/src/AngularPublic.js +++ b/src/AngularPublic.js @@ -87,7 +87,6 @@ function publishExternalAPI(angular){              ngPluralize: ngPluralizeDirective,              ngRepeat: ngRepeatDirective,              ngShow: ngShowDirective, -            ngSubmit: ngSubmitDirective,              ngStyle: ngStyleDirective,              ngSwitch: ngSwitchDirective,              ngSwitchWhen: ngSwitchWhenDirective, diff --git a/src/ng/directive/ngEventDirs.js b/src/ng/directive/ngEventDirs.js index 4587ac89..ac860ab8 100644 --- a/src/ng/directive/ngEventDirs.js +++ b/src/ng/directive/ngEventDirs.js @@ -37,7 +37,7 @@   */  var ngEventDirectives = {};  forEach( -  'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave'.split(' '), +  'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave submit'.split(' '),    function(name) {      var directiveName = directiveNormalize('ng-' + name);      ngEventDirectives[directiveName] = ['$parse', function($parse) { @@ -166,6 +166,54 @@ forEach(  /**   * @ngdoc directive + * @name ng.directive:ngKeydown + * + * @description + * Specify custom behavior on keydown event. + * + * @element ANY + * @param {expression} ngKeydown {@link guide/expression Expression} to evaluate upon + * keydown. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngKeyup + * + * @description + * Specify custom behavior on keyup event. + * + * @element ANY + * @param {expression} ngKeyup {@link guide/expression Expression} to evaluate upon + * keyup. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngKeypress + * + * @description + * Specify custom behavior on keypress event. + * + * @element ANY + * @param {expression} ngKeypress {@link guide/expression Expression} to evaluate upon + * keypress. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive   * @name ng.directive:ngSubmit   *   * @description @@ -176,7 +224,7 @@ forEach(   * attribute**.   *   * @element form - * @param {expression} ngSubmit {@link guide/expression Expression} to eval. + * @param {expression} ngSubmit {@link guide/expression Expression} to eval. (Event object is available as `$event`)   *   * @example     <doc:example> @@ -216,8 +264,3 @@ forEach(       </doc:scenario>     </doc:example>   */ -var ngSubmitDirective = ngDirective(function(scope, element, attrs) { -  element.bind('submit', function() { -    scope.$apply(attrs.ngSubmit); -  }); -});  | 
