mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
feat(ngEventDirectives): add ngCopy, ngCut, and ngPaste
Closes #4172, #4170
This commit is contained in:
parent
0a63adce68
commit
147c6929a2
1 changed files with 46 additions and 1 deletions
|
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
var ngEventDirectives = {};
|
||||
forEach(
|
||||
'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur'.split(' '),
|
||||
'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),
|
||||
function(name) {
|
||||
var directiveName = directiveNormalize('ng-' + name);
|
||||
ngEventDirectives[directiveName] = ['$parse', function($parse) {
|
||||
|
|
@ -294,3 +294,48 @@ forEach(
|
|||
* @example
|
||||
* See {@link ng.directive:ngClick ngClick}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name ng.directive:ngCopy
|
||||
*
|
||||
* @description
|
||||
* Specify custom behavior on copy event.
|
||||
*
|
||||
* @element window, input, select, textarea, a
|
||||
* @param {expression} ngCopy {@link guide/expression Expression} to evaluate upon
|
||||
* copy. (Event object is available as `$event`)
|
||||
*
|
||||
* @example
|
||||
* See {@link ng.directive:ngClick ngClick}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name ng.directive:ngCut
|
||||
*
|
||||
* @description
|
||||
* Specify custom behavior on cut event.
|
||||
*
|
||||
* @element window, input, select, textarea, a
|
||||
* @param {expression} ngCut {@link guide/expression Expression} to evaluate upon
|
||||
* cut. (Event object is available as `$event`)
|
||||
*
|
||||
* @example
|
||||
* See {@link ng.directive:ngClick ngClick}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name ng.directive:ngPaste
|
||||
*
|
||||
* @description
|
||||
* Specify custom behavior on paste event.
|
||||
*
|
||||
* @element window, input, select, textarea, a
|
||||
* @param {expression} ngPaste {@link guide/expression Expression} to evaluate upon
|
||||
* paste. (Event object is available as `$event`)
|
||||
*
|
||||
* @example
|
||||
* See {@link ng.directive:ngClick ngClick}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue