From f54db2ccda399f2677e4ca7588018cb31545a2b4 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 8 Mar 2012 15:00:38 -0800 Subject: chore(directives,widgets): reorg the code under directive/ dir --- src/markups.js | 269 --------------------------------------------------------- 1 file changed, 269 deletions(-) delete mode 100644 src/markups.js (limited to 'src/markups.js') diff --git a/src/markups.js b/src/markups.js deleted file mode 100644 index 36b03131..00000000 --- a/src/markups.js +++ /dev/null @@ -1,269 +0,0 @@ -'use strict'; - - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng:href - * - * @description - * Using markup like {{hash}} in an href attribute makes - * the page open to a wrong URL, if the user clicks that link before - * angular has a chance to replace the {{hash}} with actual URL, the - * link will be broken and will most likely return a 404 error. - * The `ng:href` solves this problem by placing the `href` in the - * `ng:` namespace. - * - * The buggy way to write it: - *
- * 
- * 
- * - * The correct way to write it: - *
- * 
- * 
- * - * @element ANY - * @param {template} template any string which can contain `{{}}` markup. - * - * @example - * This example uses `link` variable inside `href` attribute: - - -
-
link 1 (link, don't reload)
- link 2 (link, don't reload)
- link 3 (link, reload!)
- anchor (link, don't reload)
- anchor (no link)
- link (link, change hash) - - - it('should execute ng:click but not reload when href without value', function() { - element('#link-1').click(); - expect(input('value').val()).toEqual('1'); - expect(element('#link-1').attr('href')).toBe(""); - }); - - it('should execute ng:click but not reload when href empty string', function() { - element('#link-2').click(); - expect(input('value').val()).toEqual('2'); - expect(element('#link-2').attr('href')).toBe(""); - }); - - it('should execute ng:click and change url when ng:href specified', function() { - expect(element('#link-3').attr('href')).toBe("/123"); - - element('#link-3').click(); - expect(browser().window().path()).toEqual('/123'); - }); - - it('should execute ng:click but not reload when href empty string and name specified', function() { - element('#link-4').click(); - expect(input('value').val()).toEqual('4'); - expect(element('#link-4').attr('href')).toBe(""); - }); - - it('should execute ng:click but not reload when no href but name specified', function() { - element('#link-5').click(); - expect(input('value').val()).toEqual('5'); - expect(element('#link-5').attr('href')).toBe(""); - }); - - it('should only change url when only ng:href', function() { - input('value').enter('6'); - expect(element('#link-6').attr('href')).toBe("/6"); - - element('#link-6').click(); - expect(browser().window().path()).toEqual('/6'); - }); - - - */ - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng:src - * - * @description - * Using markup like `{{hash}}` in a `src` attribute doesn't - * work right: The browser will fetch from the URL with the literal - * text `{{hash}}` until replaces the expression inside - * `{{hash}}`. The `ng:src` attribute solves this problem by placing - * the `src` attribute in the `ng:` namespace. - * - * The buggy way to write it: - *
- * 
- * 
- * - * The correct way to write it: - *
- * 
- * 
- * - * @element ANY - * @param {template} template any string which can contain `{{}}` markup. - */ - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng:disabled - * - * @description - * - * The following markup will make the button enabled on Chrome/Firefox but not on IE8 and older IEs: - *
- * 
- * - *
- *
- * - * The HTML specs do not require browsers to preserve the special attributes such as disabled. - * (The presence of them means true and absence means false) - * This prevents the angular compiler from correctly retrieving the binding expression. - * To solve this problem, we introduce ng:disabled. - * - * @example - - - Click me to toggle:
- -
- - it('should toggle button', function() { - expect(element('.doc-example-live :button').prop('disabled')).toBeFalsy(); - input('checked').check(); - expect(element('.doc-example-live :button').prop('disabled')).toBeTruthy(); - }); - -
- * - * @element ANY - * @param {template} template any string which can contain '{{}}' markup. - */ - - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng:checked - * - * @description - * The HTML specs do not require browsers to preserve the special attributes such as checked. - * (The presence of them means true and absence means false) - * This prevents the angular compiler from correctly retrieving the binding expression. - * To solve this problem, we introduce ng:checked. - * @example - - - Check me to check both:
- -
- - it('should check both checkBoxes', function() { - expect(element('.doc-example-live #checkSlave').prop('checked')).toBeFalsy(); - input('master').check(); - expect(element('.doc-example-live #checkSlave').prop('checked')).toBeTruthy(); - }); - -
- * - * @element ANY - * @param {template} template any string which can contain '{{}}' markup. - */ - - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng:multiple - * - * @description - * The HTML specs do not require browsers to preserve the special attributes such as multiple. - * (The presence of them means true and absence means false) - * This prevents the angular compiler from correctly retrieving the binding expression. - * To solve this problem, we introduce ng:multiple. - * - * @example - - - Check me check multiple:
- -
- - it('should toggle multiple', function() { - expect(element('.doc-example-live #select').prop('multiple')).toBeFalsy(); - input('checked').check(); - expect(element('.doc-example-live #select').prop('multiple')).toBeTruthy(); - }); - -
- * - * @element ANY - * @param {template} template any string which can contain '{{}}' markup. - */ - - -/** - * @ngdoc directive - * @name angular.module.ng.$compileProvider.directive.ng:readonly - * - * @description - * The HTML specs do not require browsers to preserve the special attributes such as readonly. - * (The presence of them means true and absence means false) - * This prevents the angular compiler from correctly retrieving the binding expression. - * To solve this problem, we introduce ng:readonly. - * @example - - - Check me to make text readonly:
- -
- - it('should toggle readonly attr', function() { - expect(element('.doc-example-live :text').prop('readonly')).toBeFalsy(); - input('checked').check(); - expect(element('.doc-example-live :text').prop('readonly')).toBeTruthy(); - }); - -
- * - * @element ANY - * @param {template} template any string which can contain '{{}}' markup. - */ - - -/** -* @ngdoc directive -* @name angular.module.ng.$compileProvider.directive.ng:selected -* -* @description -* The HTML specs do not require browsers to preserve the special attributes such as selected. -* (The presence of them means true and absence means false) -* This prevents the angular compiler from correctly retrieving the binding expression. -* To solve this problem, we introduce ng:selected. -* @example - - - Check me to select:
- -
- - it('should select Greetings!', function() { - expect(element('.doc-example-live #greet').prop('selected')).toBeFalsy(); - input('checked').check(); - expect(element('.doc-example-live #greet').prop('selected')).toBeTruthy(); - }); - -
-* @element ANY -* @param {template} template any string which can contain '{{}}' markup. -*/ - -- cgit v1.2.3