diff options
| author | Misko Hevery | 2011-12-14 02:55:31 +0100 | 
|---|---|---|
| committer | Misko Hevery | 2012-01-25 11:53:59 -0800 | 
| commit | 4804c83b7db5770d5d02eea9eea4cc012b4aa524 (patch) | |
| tree | be5ae1743179704cc1638f186cddba8d6e3fa37d /src | |
| parent | e2b1d9e994e50bcd01d237302a3357bc7ebb6fa5 (diff) | |
| download | angular.js-4804c83b7db5770d5d02eea9eea4cc012b4aa524.tar.bz2 | |
docs(compiler): update the compiler docs
Diffstat (limited to 'src')
| -rw-r--r-- | src/directives.js | 198 | ||||
| -rw-r--r-- | src/jqLite.js | 11 | ||||
| -rw-r--r-- | src/loader.js | 14 | ||||
| -rw-r--r-- | src/markups.js | 14 | ||||
| -rw-r--r-- | src/scenario/SpecRunner.js | 4 | ||||
| -rw-r--r-- | src/service/compiler.js | 6 | ||||
| -rw-r--r-- | src/service/formFactory.js | 17 | ||||
| -rw-r--r-- | src/service/http.js | 10 | ||||
| -rw-r--r-- | src/service/route.js | 6 | ||||
| -rw-r--r-- | src/service/sanitize.js | 4 | ||||
| -rw-r--r-- | src/service/scope.js | 7 | ||||
| -rw-r--r-- | src/widget/form.js | 2 | ||||
| -rw-r--r-- | src/widget/input.js | 6 | ||||
| -rw-r--r-- | src/widget/select.js | 8 | ||||
| -rw-r--r-- | src/widgets.js | 41 | 
15 files changed, 200 insertions, 148 deletions
| diff --git a/src/directives.js b/src/directives.js index dc0a986f..70b09c88 100644 --- a/src/directives.js +++ b/src/directives.js @@ -1,40 +1,8 @@  'use strict';  /** - * @ngdoc function - * @name angular.directive - * @description - * - * Angular directives create custom attributes for DOM elements. A directive can modify the - * behavior of the element in which it is specified. Do not use directives to add elements to the - * DOM; instead, use {@link angular.widget widgets} to add DOM elements. - * - * For more information about how Angular directives work, and to learn how to create your own - * directives, see {@link guide/dev_guide.compiler.directives Understanding Angular Directives} in - * the Angular Developer Guide. - * - * @param {string} name Directive identifier (case insensitive). - * @param {function(string, Element)} compileFn Also called "template function" is a function called - *    during compilation of the template when the compiler comes across the directive being - *    registered. The string value of the element attribute representing the directive and - *    jQuery/jqLite wrapped DOM element are passed as arguments to this function. - * - *    The `compileFn` function may return a linking function also called an instance function. - *    This function is called during the linking phase when a Scope is being associated with the - *    template or template clone (see repeater notes below). The signature of the linking function - *    is: `function(Element)` where Element is jQuery/jqLite wrapped DOM Element that is being - *    linked. - * - * The biggest differenciator between the compile and linking functions is how they are being called - * when a directive is present within an {@link angular.widget.@ng:repeat ng:repeat}. In this case, - * the compile function gets called once per occurence of the directive in the template. On the - * other hand the linking function gets called once for each repeated clone of the template (times - * number of occurences of the directive in the repeated template). - */ - -/**   * @ngdoc directive - * @name angular.directive.ng:init + * @name angular.module.ng.$compileProvider.directive.ng:init   *   * @description   * The `ng:init` attribute specifies initialization tasks to be executed @@ -70,7 +38,7 @@ var ngInitDirective = valueFn({  /**   * @ngdoc directive - * @name angular.directive.ng:controller + * @name angular.module.ng.$compileProvider.directive.ng:controller   *   * @description   * The `ng:controller` directive assigns behavior to a scope. This is a key aspect of how angular @@ -183,7 +151,7 @@ var ngControllerDirective = ['$controller', '$window', function($controller, $wi  /**   * @ngdoc directive - * @name angular.directive.ng:bind + * @name angular.module.ng.$compileProvider.directive.ng:bind   *   * @description   * The `ng:bind` attribute tells Angular to replace the text content of the specified HTML element @@ -248,7 +216,7 @@ var ngBindHtmlDirective = ['$sanitize', function($sanitize) {  /**   * @ngdoc directive - * @name angular.directive.ng:bind-template + * @name angular.module.ng.$compileProvider.directive.ng:bind-template   *   * @description   * The `ng:bind-template` attribute specifies that the element @@ -305,7 +273,7 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) {  /**   * @ngdoc directive - * @name angular.directive.ng:bind-attr + * @name angular.module.ng.$compileProvider.directive.ng:bind-attr   *   * @description   * The `ng:bind-attr` attribute specifies that a @@ -333,7 +301,7 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) {   * During compilation, the template with attribute markup gets translated to the ng:bind-attr form   * mentioned above.   * - * _Note_: You might want to consider using {@link angular.directive.ng:href ng:href} instead of + * _Note_: You might want to consider using {@link angular.module.ng.$compileProvider.directive.ng:href ng:href} instead of   * `href` if the binding is present in the main application template (`index.html`) and you want to   * make sure that a user is not capable of clicking on raw/uncompiled link.   * @@ -399,7 +367,7 @@ var ngBindAttrDirective = ['$interpolate', function($interpolate) {  /**   * @ngdoc directive - * @name angular.directive.ng:click + * @name angular.module.ng.$compileProvider.directive.ng:click   *   * @description   * The ng:click allows you to specify custom behavior when @@ -435,33 +403,133 @@ var ngBindAttrDirective = ['$interpolate', function($interpolate) {   * TODO: maybe we should consider allowing users to control event propagation in the future.   */  var ngEventDirectives = {}; -forEach('click dblclick mousedown mouseup mouseover mousemove'.split(' '), function(name) { -  var directiveName = camelCase('ng-' + name); -  ngEventDirectives[directiveName] = valueFn(function(scope, element, attr) { -    element.bind(lowercase(name), function(event) { -      scope.$apply(attr[directiveName]); -      event.stopPropagation(); +forEach( +  'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave'.split(' '), +  function(name) { +    var directiveName = directiveNormalize('ng-' + name); +    ngEventDirectives[directiveName] = valueFn(function(scope, element, attr) { +      element.bind(lowercase(name), function(event) { +        scope.$apply(attr[directiveName]); +        event.stopPropagation(); +      });      }); -  }); -}); +  } +); + +/** + * @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} expression {@link guide/dev_guide.expressions Expression} to evaluate upon + * dblclick. + * + * @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} expression {@link guide/dev_guide.expressions Expression} to evaluate upon + * mousedown. + * + * @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} expression {@link guide/dev_guide.expressions Expression} to evaluate upon + * mouseup. + * + * @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} expression {@link guide/dev_guide.expressions Expression} to evaluate upon + * mouseover. + * + * @example + * See {@link angular.module.ng.$compileProvider.directive.ng:click ng:click} + */  /**   * @ngdoc directive - * @name angular.directive.ng:dblclick + * @name angular.module.ng.$compileProvider.directive.ng:mouseenter   *   * @description - * The ng:dblclick allows you to specify custom behavior when - * element is double-clicked. + * Specify custom behavior on mouseenter event.   *   * @element ANY   * @param {expression} expression {@link guide/dev_guide.expressions Expression} to evaluate upon - * double-click. + * mouseenter. + * + * @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} expression {@link guide/dev_guide.expressions Expression} to evaluate upon + * mouseleave. + * + * @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} expression {@link guide/dev_guide.expressions Expression} to evaluate upon + * mousemove. + * + * @example + * See {@link angular.module.ng.$compileProvider.directive.ng:click ng:click} + */ + +  /**   * @ngdoc directive - * @name angular.directive.ng:submit + * @name angular.module.ng.$compileProvider.directive.ng:submit   *   * @description   * Enables binding angular expressions to onsubmit events. @@ -536,7 +604,7 @@ function classDirective(name, selector) {  /**   * @ngdoc directive - * @name angular.directive.ng:class + * @name angular.module.ng.$compileProvider.directive.ng:class   *   * @description   * The `ng:class` allows you to set CSS class on HTML element dynamically by databinding an @@ -582,15 +650,15 @@ var ngClassDirective = classDirective('', true);  /**   * @ngdoc directive - * @name angular.directive.ng:class-odd + * @name angular.module.ng.$compileProvider.directive.ng:class-odd   *   * @description   * The `ng:class-odd` and `ng:class-even` works exactly as - * {@link angular.directive.ng:class ng:class}, except it works in conjunction with `ng:repeat` and + * {@link angular.module.ng.$compileProvider.directive.ng:class ng:class}, except it works in conjunction with `ng:repeat` and   * takes affect only on odd (even) rows.   *   * This directive can be applied only within a scope of an - * {@link angular.widget.@ng:repeat ng:repeat}. + * {@link angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat}.   *   * @element ANY   * @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. The result @@ -622,15 +690,15 @@ var ngClassOddDirective = classDirective('Odd', 0);  /**   * @ngdoc directive - * @name angular.directive.ng:class-even + * @name angular.module.ng.$compileProvider.directive.ng:class-even   *   * @description   * The `ng:class-odd` and `ng:class-even` works exactly as - * {@link angular.directive.ng:class ng:class}, except it works in conjunction with `ng:repeat` and + * {@link angular.module.ng.$compileProvider.directive.ng:class ng:class}, except it works in conjunction with `ng:repeat` and   * takes affect only on odd (even) rows.   *   * This directive can be applied only within a scope of an - * {@link angular.widget.@ng:repeat ng:repeat}. + * {@link angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat}.   *   * @element ANY   * @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. The result @@ -661,7 +729,7 @@ var ngClassEvenDirective = classDirective('Even', 1);  /**   * @ngdoc directive - * @name angular.directive.ng:show + * @name angular.module.ng.$compileProvider.directive.ng:show   *   * @description   * The `ng:show` and `ng:hide` directives show or hide a portion of the DOM tree (HTML) @@ -700,7 +768,7 @@ var ngShowDirective = valueFn(function(scope, element, attr){  /**   * @ngdoc directive - * @name angular.directive.ng:hide + * @name angular.module.ng.$compileProvider.directive.ng:hide   *   * @description   * The `ng:hide` and `ng:show` directives hide or show a portion @@ -739,7 +807,7 @@ var ngHideDirective = valueFn(function(scope, element, attr){  /**   * @ngdoc directive - * @name angular.directive.ng:style + * @name angular.module.ng.$compileProvider.directive.ng:style   *   * @description   * The ng:style allows you to set CSS style on an HTML element conditionally. @@ -781,7 +849,7 @@ var ngStyleDirective = valueFn(function(scope, element, attr) {  /**   * @ngdoc directive - * @name angular.directive.ng:cloak + * @name angular.module.ng.$compileProvider.directive.ng:cloak   *   * @description   * The `ng:cloak` directive is used to prevent the Angular html template from being briefly @@ -840,9 +908,9 @@ var ngCloakDirective = valueFn({  });  function ngAttributeAliasDirective(propName, attrName) { -  ngAttributeAliasDirectives[camelCase('ng-' + attrName)] = ['$interpolate', function($interpolate) { +  ngAttributeAliasDirectives[directiveNormalize('ng-' + attrName)] = ['$interpolate', function($interpolate) {      return function(scope, element, attr) { -      scope.$watch($interpolate(attr[camelCase('ng-' + attrName)]), function(value) { +      scope.$watch($interpolate(attr[directiveNormalize('ng-' + attrName)]), function(value) {          attr.$set(attrName, value);        });      } diff --git a/src/jqLite.js b/src/jqLite.js index 2505a307..12ef39c3 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -101,22 +101,15 @@ function getStyle(element) {  var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g; -var PREFIX_REGEXP = /^(x[\:\-_]|data[\:\-_])/i;  var MOZ_HACK_REGEXP = /^moz([A-Z])/; +  /** - * Converts all accepted directives format into proper directive name. - * All of these will become 'myDirective': - *   my:DiRective - *   my-directive - *   x-my-directive - *   data-my:directive - * + * Converts snake_case to camelCase.   * Also there is special case for Moz prefix starting with upper case letter.   * @param name Name to normalize   */  function camelCase(name) {    return name. -    replace(PREFIX_REGEXP, '').      replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {        return offset ? letter.toUpperCase() : letter;      }). diff --git a/src/loader.js b/src/loader.js index 3abbfd0e..d703e566 100644 --- a/src/loader.js +++ b/src/loader.js @@ -143,7 +143,7 @@ function setupModuleLoader(window) {             * @ngdoc method             * @name angular.Module#filter             * @methodOf angular.Module -           * @param {string} name filterr name +           * @param {string} name filter name             * @param {Function} filterFactory Factory function for creating new instance of filter.             * @description             * See {@link angular.module.ng.$filterProvider#register $filterProvider.register()}. @@ -152,6 +152,18 @@ function setupModuleLoader(window) {            /**             * @ngdoc method +           * @name angular.Module#directive +           * @methodOf angular.Module +           * @param {string} name directive name +           * @param {Function} directiveFactory Factory function for creating new instance of +           * directives. +           * @description +           * See {@link angular.module.ng.$compileProvider#directive $compileProvider.directive()}. +           */ +          directive: invokeLater('$compileProvider', 'directive'), + +          /** +           * @ngdoc method             * @name angular.Module#config             * @methodOf angular.Module             * @param {Function} configFn Execute this function on module load. Useful for service diff --git a/src/markups.js b/src/markups.js index 9e3e16f0..36b03131 100644 --- a/src/markups.js +++ b/src/markups.js @@ -3,7 +3,7 @@  /**   * @ngdoc directive - * @name angular.directive.ng:href + * @name angular.module.ng.$compileProvider.directive.ng:href   *   * @description   * Using <angular/> markup like {{hash}} in an href attribute makes @@ -83,7 +83,7 @@  /**   * @ngdoc directive - * @name angular.directive.ng:src + * @name angular.module.ng.$compileProvider.directive.ng:src   *   * @description   * Using <angular/> markup like `{{hash}}` in a `src` attribute doesn't @@ -108,7 +108,7 @@  /**   * @ngdoc directive - * @name angular.directive.ng:disabled + * @name angular.module.ng.$compileProvider.directive.ng:disabled   *   * @description   * @@ -146,7 +146,7 @@  /**   * @ngdoc directive - * @name angular.directive.ng:checked + * @name angular.module.ng.$compileProvider.directive.ng:checked   *   * @description   * The HTML specs do not require browsers to preserve the special attributes such as checked. @@ -175,7 +175,7 @@  /**   * @ngdoc directive - * @name angular.directive.ng:multiple + * @name angular.module.ng.$compileProvider.directive.ng:multiple   *   * @description   * The HTML specs do not require browsers to preserve the special attributes such as multiple. @@ -210,7 +210,7 @@  /**   * @ngdoc directive - * @name angular.directive.ng:readonly + * @name angular.module.ng.$compileProvider.directive.ng:readonly   *   * @description   * The HTML specs do not require browsers to preserve the special attributes such as readonly. @@ -239,7 +239,7 @@  /**  * @ngdoc directive -* @name angular.directive.ng:selected +* @name angular.module.ng.$compileProvider.directive.ng:selected  *  * @description  * The HTML specs do not require browsers to preserve the special attributes such as selected. diff --git a/src/scenario/SpecRunner.js b/src/scenario/SpecRunner.js index eacf13a8..f4b9b0a7 100644 --- a/src/scenario/SpecRunner.js +++ b/src/scenario/SpecRunner.js @@ -105,6 +105,7 @@ angular.scenario.SpecRunner.prototype.addFuture = function(name, behavior, line)   */  angular.scenario.SpecRunner.prototype.addFutureAction = function(name, behavior, line) {    var self = this; +  var NG = /\[ng\\\:/;    return this.addFuture(name, function(done) {      this.application.executeAction(function($window, $document) { @@ -117,6 +118,9 @@ angular.scenario.SpecRunner.prototype.addFutureAction = function(name, behavior,            selector = selector.replace('$' + (index + 1), value);          });          var result = $document.find(selector); +        if (selector.match(NG)) { +          result = result.add(selector.replace(NG, '[ng-'), $document); +        }          if (!result.length) {            throw {              type: 'selector', diff --git a/src/service/compiler.js b/src/service/compiler.js index c663baac..acfc7851 100644 --- a/src/service/compiler.js +++ b/src/service/compiler.js @@ -49,9 +49,9 @@          })        }); -      function Ctrl() { -        this.name = 'Angular'; -        this.html = 'Hello {{name}}'; +      function Ctrl($scope) { +        $scope.name = 'Angular'; +        $scope.html = 'Hello {{name}}';        }      </script>      <div ng-controller="Ctrl"> diff --git a/src/service/formFactory.js b/src/service/formFactory.js index 727a243c..807f4113 100644 --- a/src/service/formFactory.js +++ b/src/service/formFactory.js @@ -22,26 +22,27 @@   * This example shows how one could write a widget which would enable data-binding on   * `contenteditable` feature of HTML.   * -    <doc:example> +    <doc:example module="formModule">        <doc:source>          <script>            function EditorCntl($scope) { -            $scope.html = '<b>Hello</b> <i>World</i>!'; +            $scope.htmlContent = '<b>Hello</b> <i>World</i>!';            } -          HTMLEditorWidget.$inject = ['$element', '$scope', 'htmlFilter']; -          function HTMLEditorWidget(element, scope, htmlFilter) { +          HTMLEditorWidget.$inject = ['$scope', '$element', '$sanitize']; +          function HTMLEditorWidget(scope, element, $sanitize) {              scope.$parseModel = function() {                // need to protect for script injection                try { -                this.$viewValue = htmlFilter(this.$modelValue || '').get(); +                scope.$viewValue = $sanitize( +                  scope.$modelValue || '');                  if (this.$error.HTML) {                    // we were invalid, but now we are OK. -                  this.$emit('$valid', 'HTML'); +                  scope.$emit('$valid', 'HTML');                  }                } catch (e) {                  // if HTML not parsable invalidate form. -                this.$emit('$invalid', 'HTML'); +                scope.$emit('$invalid', 'HTML');                }              } @@ -128,7 +129,7 @@ function $FormFactoryProvider() {       * Static method on `$formFactory` service.       *       * Retrieve the closest form for a given element or defaults to the `root` form. Used by the -     * {@link angular.widget.form form} element. +     * {@link angular.module.ng.$compileProvider.directive.form form} element.       * @param {Element} element The element where the search for form should initiate.       */      formFactory.forElement = function(element) { diff --git a/src/service/http.js b/src/service/http.js index 9d57ed76..93d44eac 100644 --- a/src/service/http.js +++ b/src/service/http.js @@ -438,14 +438,14 @@ function $HttpProvider() {              it('should make an xhr GET request', function() {                element(':button:contains("Sample GET")').click();                element(':button:contains("fetch")').click(); -              expect(binding('status')).toBe('http status code: 200'); -              expect(binding('data')).toBe('http response data: Hello, $http!\n'); +              expect(binding('status')).toBe('200'); +              expect(binding('data')).toBe('Hello, $http!\n');              });              it('should make a JSONP request to angularjs.org', function() {                element(':button:contains("Sample JSONP")').click();                element(':button:contains("fetch")').click(); -              expect(binding('status')).toBe('http status code: 200'); +              expect(binding('status')).toBe('200');                expect(binding('data')).toMatch(/Super Hero!/);              }); @@ -453,8 +453,8 @@ function $HttpProvider() {                  function() {                element(':button:contains("Invalid JSONP")').click();                element(':button:contains("fetch")').click(); -              expect(binding('status')).toBe('http status code: 0'); -              expect(binding('data')).toBe('http response data: Request failed'); +              expect(binding('status')).toBe('0'); +              expect(binding('data')).toBe('Request failed');              });            </doc:scenario>          </doc:example> diff --git a/src/service/route.js b/src/service/route.js index f8200fd4..9b52c4b0 100644 --- a/src/service/route.js +++ b/src/service/route.js @@ -13,7 +13,7 @@   * Watches `$location.url()` and tries to map the path to an existing route   * definition. It is used for deep-linking URLs to controllers and views (HTML partials).   * - * The `$route` service is typically used in conjunction with {@link angular.widget.ng:view ng:view} + * The `$route` service is typically used in conjunction with {@link angular.module.ng.$compileProvider.directive.ng:view ng:view}   * widget and the {@link angular.module.ng.$routeParams $routeParams} service.   *   * @example @@ -150,8 +150,8 @@ function $RouteProvider(){             *    - `controller` – `{function()=}` – Controller fn that should be associated with newly             *      created scope.             *    - `template` – `{string=}` – path to an html template that should be used by -           *      {@link angular.widget.ng:view ng:view} or -           *      {@link angular.widget.ng:include ng:include} widgets. +           *      {@link angular.module.ng.$compileProvider.directive.ng:view ng:view} or +           *      {@link angular.module.ng.$compileProvider.directive.ng:include ng:include} widgets.             *    - `redirectTo` – {(string|function())=} – value to update             *      {@link angular.module.ng.$location $location} path with and trigger route redirection.             * diff --git a/src/service/sanitize.js b/src/service/sanitize.js index 0d5c74af..1e201691 100644 --- a/src/service/sanitize.js +++ b/src/service/sanitize.js @@ -37,8 +37,8 @@     <doc:example>       <doc:source>         <script> -         function Ctrl() { -           this.snippet = +         function Ctrl($scope) { +           $scope.snippet =               '<p style="color:blue">an html\n' +               '<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +               'snippet</p>'; diff --git a/src/service/scope.js b/src/service/scope.js index f59417bc..4abf96f1 100644 --- a/src/service/scope.js +++ b/src/service/scope.js @@ -277,9 +277,10 @@ function $RootScopeProvider(){         * `'Maximum iteration limit exceeded.'` if the number of iterations exceeds 100.         *         * Usually you don't call `$digest()` directly in -       * {@link angular.directive.ng:controller controllers} or in {@link angular.directive directives}. +       * {@link angular.module.ng.$compileProvider.directive.ng:controller controllers} or in  +       * {@link angular.module.ng.$compileProvider.directive directives}.         * Instead a call to {@link angular.module.ng.$rootScope.Scope#$apply $apply()} (typically from within a -       * {@link angular.directive directive}) will force a `$digest()`. +       * {@link angular.module.ng.$compileProvider.directive directives}) will force a `$digest()`.         *         * If you want to be notified whenever `$digest()` is called,         * you can register a `watchExpression` function  with {@link angular.module.ng.$rootScope.Scope#$watch $watch()} @@ -396,7 +397,7 @@ function $RootScopeProvider(){         * The destructing scope emits an `$destroy` {@link angular.module.ng.$rootScope.Scope#$emit event}.         *         * The `$destroy()` is usually used by directives such as -       * {@link angular.widget.@ng:repeat ng:repeat} for managing the unrolling of the loop. +       * {@link angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat} for managing the unrolling of the loop.         *         */        $destroy: function() { diff --git a/src/widget/form.js b/src/widget/form.js index 405aae74..552cc4e5 100644 --- a/src/widget/form.js +++ b/src/widget/form.js @@ -2,7 +2,7 @@  /**   * @ngdoc widget - * @name angular.widget.form + * @name angular.module.ng.$compileProvider.directive.form   *   * @description   * Angular widget that creates a form scope using the diff --git a/src/widget/input.js b/src/widget/input.js index 9f9d9852..9f522d18 100644 --- a/src/widget/input.js +++ b/src/widget/input.js @@ -603,7 +603,7 @@ var HTML5_INPUTS_TYPES =  makeMap(  /**   * @ngdoc widget - * @name angular.widget.input + * @name angular.module.ng.$compileProvider.directive.input   *   * @description   * HTML input element widget with angular data-binding. Input widget follows HTML5 input types @@ -827,12 +827,12 @@ var inputDirective = ['$defer', '$formFactory', function($defer, $formFactory) {  /**   * @ngdoc widget - * @name angular.widget.textarea + * @name angular.module.ng.$compileProvider.directive.textarea   *   * @description   * HTML textarea element widget with angular data-binding. The data-binding and validation   * properties of this element are exactly the same as those of the - * {@link angular.widget.input input element}. + * {@link angular.module.ng.$compileProvider.directive.input input element}.   *   * @param {string} type Widget types as defined by {@link angular.inputType}. If the   *    type is in the format of `@ScopeType` then `ScopeType` is loaded from the diff --git a/src/widget/select.js b/src/widget/select.js index ae9e1b7c..332009d2 100644 --- a/src/widget/select.js +++ b/src/widget/select.js @@ -2,7 +2,7 @@  /**   * @ngdoc widget - * @name angular.widget.select + * @name angular.module.ng.$compileProvider.directive.select   *   * @description   * HTML `SELECT` element with angular data-binding. @@ -12,7 +12,7 @@   * Optionally `ng:options` attribute can be used to dynamically generate a list of `<option>`   * elements for a `<select>` element using an array or an object obtained by evaluating the   * `ng:options` expression. - * + *˝˝   * When an item in the select menu is select, the value of array element or object property   * represented by the selected option will be bound to the model identified by the `ng:model` attribute   * of the parent select element. @@ -22,13 +22,13 @@   * option. See example below for demonstration.   *   * Note: `ng:options` provides iterator facility for `<option>` element which must be used instead - * of {@link angular.widget.@ng:repeat ng:repeat}. `ng:repeat` is not suitable for use with + * of {@link angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat}. `ng:repeat` is not suitable for use with   * `<option>` element because of the following reasons:   *   *   * value attribute of the option element that we need to bind to requires a string, but the   *     source of data for the iteration might be in a form of array containing objects instead of   *     strings - *   * {@link angular.widget.@ng:repeat ng:repeat} unrolls after the select binds causing + *   * {@link angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat} unrolls after the select binds causing   *     incorect rendering on most browsers.   *   * binding to a value not in list confuses most browsers.   * diff --git a/src/widgets.js b/src/widgets.js index 68c40b92..18ac27c3 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -1,35 +1,8 @@  'use strict';  /** - * @ngdoc overview - * @name angular.widget - * @description - * - * An angular widget can be either a custom attribute that modifies an existing DOM element or an - * entirely new DOM element. - * - * During html compilation, widgets are processed after {@link angular.markup markup}, but before - * {@link angular.directive directives}. - * - * Following is the list of built-in angular widgets: - * - * * {@link angular.widget.@ng:non-bindable ng:non-bindable} - Blocks angular from processing an - *   HTML element. - * * {@link angular.widget.@ng:repeat ng:repeat} - Creates and manages a collection of cloned HTML - *   elements. - * * {@link angular.inputType HTML input elements} - Standard HTML input elements data-bound by - *   angular. - * * {@link angular.widget.ng:view ng:view} - Works with $route to "include" partial templates - * * {@link angular.widget.ng:switch ng:switch} - Conditionally changes DOM structure - * * {@link angular.widget.ng:include ng:include} - Includes an external HTML fragment - * - * For more information about angular widgets, see {@link guide/dev_guide.compiler.widgets - * Understanding Angular Widgets} in the angular Developer Guide. - */ - -/**   * @ngdoc widget - * @name angular.widget.ng:include + * @name angular.module.ng.$compileProvider.directive.ng:include   *   * @description   * Fetches, compiles and includes an external HTML fragment. @@ -146,7 +119,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'  /**   * @ngdoc widget - * @name angular.widget.ng:switch + * @name angular.module.ng.$compileProvider.directive.ng:switch   *   * @description   * Conditionally change the DOM structure. @@ -290,7 +263,7 @@ var htmlAnchorDirective = valueFn({  /**   * @ngdoc widget - * @name angular.widget.@ng:repeat + * @name angular.module.ng.$compileProvider.directive.ng:repeat   *   * @description   * The `ng:repeat` widget instantiates a template once per item from a collection. Each template @@ -474,7 +447,7 @@ var ngRepeatDirective = ['$compile', function($compile) {  /**   * @ngdoc widget - * @name angular.widget.@ng:non-bindable + * @name angular.module.ng.$compileProvider.directive.ng:non-bindable   *   * @description   * Sometimes it is necessary to write code which looks like bindings but which should be left alone @@ -508,7 +481,7 @@ var ngNonBindableDirective = valueFn({ terminal: true });  /**   * @ngdoc widget - * @name angular.widget.ng:view + * @name angular.module.ng.$compileProvider.directive.ng:view   *   * @description   * # Overview @@ -517,7 +490,7 @@ var ngNonBindableDirective = valueFn({ terminal: true });   * Every time the current route changes, the included view changes with it according to the   * configuration of the `$route` service.   * - * This widget provides functionality similar to {@link angular.widget.ng:include ng:include} when + * This widget provides functionality similar to {@link angular.module.ng.$compileProvider.directive.ng:include ng:include} when   * used like this:   *   *     <ng:include src="$route.current.template" scope="$route.current.scope"></ng:include> @@ -617,7 +590,7 @@ var ngViewDirective = ['$http', '$templateCache', '$route', '$anchorScroll', '$c  /**   * @ngdoc widget - * @name angular.widget.ng:pluralize + * @name angular.module.ng.$compileProvider.directive.ng:pluralize   *   * @description   * # Overview | 
