From 2430f52bb97fa9d682e5f028c977c5bf94c5ec38 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 23 Mar 2012 14:03:24 -0700 Subject: chore(module): move files around in preparation for more modules --- src/directive/ngEventDirs.js | 222 ------------------------------------------- 1 file changed, 222 deletions(-) delete mode 100644 src/directive/ngEventDirs.js (limited to 'src/directive/ngEventDirs.js') diff --git a/src/directive/ngEventDirs.js b/src/directive/ngEventDirs.js deleted file mode 100644 index 74028fee..00000000 --- a/src/directive/ngEventDirs.js +++ /dev/null @@ -1,222 +0,0 @@ -'use strict'; - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng-click - * - * @description - * The ng-click allows you to specify custom behavior when - * element is clicked. - * - * @element ANY - * @param {expression} ng-click {@link guide/dev_guide.expressions Expression} to evaluate upon - * click. (Event object is available as `$event`) - * - * @example - - - - count: {{count}} - - - it('should check ng-click', function() { - expect(binding('count')).toBe('0'); - element('.doc-example-live :button').click(); - expect(binding('count')).toBe('1'); - }); - - - */ -/* - * A directive that allows creation of custom onclick handlers that are defined as angular - * expressions and are compiled and executed within the current scope. - * - * Events that are handled via these handler are always configured not to propagate further. - */ -var ngEventDirectives = {}; -forEach( - 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave'.split(' '), - function(name) { - var directiveName = directiveNormalize('ng-' + name); - ngEventDirectives[directiveName] = ['$parse', function($parse) { - return function(scope, element, attr) { - var fn = $parse(attr[directiveName]); - element.bind(lowercase(name), function(event) { - scope.$apply(function() { - fn(scope, {$event:event}); - }); - }); - }; - }]; - } -); - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng-dblclick - * - * @description - * The ng-dblclick allows you to specify custom behavior on dblclick event. - * - * @element ANY - * @param {expression} ng-dblclick {@link guide/dev_guide.expressions Expression} to evaluate upon - * dblclick. (Event object is available as `$event`) - * - * @example - * See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click} - */ - - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng-mousedown - * - * @description - * The ng-mousedown allows you to specify custom behavior on mousedown event. - * - * @element ANY - * @param {expression} ng-mousedown {@link guide/dev_guide.expressions Expression} to evaluate upon - * mousedown. (Event object is available as `$event`) - * - * @example - * See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click} - */ - - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng-mouseup - * - * @description - * Specify custom behavior on mouseup event. - * - * @element ANY - * @param {expression} ng-mouseup {@link guide/dev_guide.expressions Expression} to evaluate upon - * mouseup. (Event object is available as `$event`) - * - * @example - * See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click} - */ - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng-mouseover - * - * @description - * Specify custom behavior on mouseover event. - * - * @element ANY - * @param {expression} ng-mouseover {@link guide/dev_guide.expressions Expression} to evaluate upon - * mouseover. (Event object is available as `$event`) - * - * @example - * See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click} - */ - - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng-mouseenter - * - * @description - * Specify custom behavior on mouseenter event. - * - * @element ANY - * @param {expression} ng-mouseenter {@link guide/dev_guide.expressions Expression} to evaluate upon - * mouseenter. (Event object is available as `$event`) - * - * @example - * See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click} - */ - - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng-mouseleave - * - * @description - * Specify custom behavior on mouseleave event. - * - * @element ANY - * @param {expression} ng-mouseleave {@link guide/dev_guide.expressions Expression} to evaluate upon - * mouseleave. (Event object is available as `$event`) - * - * @example - * See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click} - */ - - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng-mousemove - * - * @description - * Specify custom behavior on mousemove event. - * - * @element ANY - * @param {expression} ng-mousemove {@link guide/dev_guide.expressions Expression} to evaluate upon - * mousemove. (Event object is available as `$event`) - * - * @example - * See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click} - */ - - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng-submit - * - * @description - * Enables binding angular expressions to onsubmit events. - * - * Additionally it prevents the default action (which for form means sending the request to the - * server and reloading the current page). - * - * @element form - * @param {expression} ng-submit {@link guide/dev_guide.expressions Expression} to eval. - * - * @example - - - -
- Enter text and hit enter: - - -
list={{list}}
-
-
- - it('should check ng-submit', function() { - expect(binding('list')).toBe('[]'); - element('.doc-example-live #submit').click(); - expect(binding('list')).toBe('["hello"]'); - expect(input('text').val()).toBe(''); - }); - it('should ignore empty strings', function() { - expect(binding('list')).toBe('[]'); - element('.doc-example-live #submit').click(); - element('.doc-example-live #submit').click(); - expect(binding('list')).toBe('["hello"]'); - }); - -
- */ -var ngSubmitDirective = ngDirective(function(scope, element, attrs) { - element.bind('submit', function() { - scope.$apply(attrs.ngSubmit); - }); -}); -- cgit v1.2.3