From 3e5377f4f3b1d0f06af50e21026835bee0556b4a Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 9 Mar 2012 15:12:48 -0800 Subject: doc(fixes): to better support ng-directive notation --- src/Angular.js | 2 +- src/directive/booleanAttrDirs.js | 89 ++++++++++++++++++++++------------------ src/directive/form.js | 1 + src/directive/input.js | 2 + src/directive/ngBind.js | 1 + src/directive/ngSwitch.js | 2 +- src/directive/script.js | 1 + src/directive/select.js | 1 + src/widgets.js | 0 9 files changed, 56 insertions(+), 43 deletions(-) delete mode 100644 src/widgets.js (limited to 'src') diff --git a/src/Angular.js b/src/Angular.js index 7ab0e7f6..cdffcf1d 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -818,7 +818,7 @@ function encodeUriQuery(val, pctEncodeSpaces) { * @name angular.module.ng.$compileProvider.directive.ng-app * * @element ANY - * @param {angular.Module} module on optional application + * @param {angular.Module} ng-app on optional application * {@link angular.module module} name to load. * * @description diff --git a/src/directive/booleanAttrDirs.js b/src/directive/booleanAttrDirs.js index 0c1731a8..10c6eee8 100644 --- a/src/directive/booleanAttrDirs.js +++ b/src/directive/booleanAttrDirs.js @@ -3,6 +3,7 @@ /** * @ngdoc directive * @name angular.module.ng.$compileProvider.directive.ng-href + * @restrict A * * @description * Using markup like {{hash}} in an href attribute makes @@ -22,8 +23,8 @@ * * * - * @element ANY - * @param {template} template any string which can contain `{{}}` markup. + * @element A + * @param {template} ng-href any string which can contain `{{}}` markup. * * @example * This example uses `link` variable inside `href` attribute: @@ -83,6 +84,7 @@ /** * @ngdoc directive * @name angular.module.ng.$compileProvider.directive.ng-src + * @restrict A * * @description * Using markup like `{{hash}}` in a `src` attribute doesn't @@ -101,13 +103,14 @@ * * * - * @element ANY - * @param {template} template any string which can contain `{{}}` markup. + * @element IMG + * @param {template} ng-src any string which can contain `{{}}` markup. */ /** * @ngdoc directive * @name angular.module.ng.$compileProvider.directive.ng-disabled + * @restrict A * * @description * @@ -138,14 +141,15 @@ * - * @element ANY - * @param {template} template any string which can contain '{{}}' markup. + * @element INPUT + * @param {template} ng-disabled any string which can contain '{{}}' markup. */ /** * @ngdoc directive * @name angular.module.ng.$compileProvider.directive.ng-checked + * @restrict A * * @description * The HTML specs do not require browsers to preserve the special attributes such as checked. @@ -167,14 +171,15 @@ * - * @element ANY - * @param {template} template any string which can contain '{{}}' markup. + * @element INPUT + * @param {template} ng-checked any string which can contain '{{}}' markup. */ /** * @ngdoc directive * @name angular.module.ng.$compileProvider.directive.ng-multiple + * @restrict A * * @description * The HTML specs do not require browsers to preserve the special attributes such as multiple. @@ -202,14 +207,15 @@ * - * @element ANY - * @param {template} template any string which can contain '{{}}' markup. + * @element SELECT + * @param {template} ng-multiple any string which can contain '{{}}' markup. */ /** * @ngdoc directive * @name angular.module.ng.$compileProvider.directive.ng-readonly + * @restrict A * * @description * The HTML specs do not require browsers to preserve the special attributes such as readonly. @@ -231,41 +237,42 @@ * - * @element ANY - * @param {template} template any string which can contain '{{}}' markup. + * @element INPUT + * @param {template} ng-readonly 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. -*/ - + * @ngdoc directive + * @name angular.module.ng.$compileProvider.directive.ng-selected + * @restrict A + * + * @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 OPTION + * @param {template} ng-selected any string which can contain '{{}}' markup. + */ + function ngAttributeAliasDirective(propName, attrName) { ngAttributeAliasDirectives[directiveNormalize('ng-' + attrName)] = valueFn( diff --git a/src/directive/form.js b/src/directive/form.js index 84352902..96f7632b 100644 --- a/src/directive/form.js +++ b/src/directive/form.js @@ -105,6 +105,7 @@ function FormController($scope, name) { /** * @ngdoc directive * @name angular.module.ng.$compileProvider.directive.form + * @restrict EA * * @scope * @description diff --git a/src/directive/input.js b/src/directive/input.js index cccfb675..1a3acd01 100644 --- a/src/directive/input.js +++ b/src/directive/input.js @@ -616,6 +616,7 @@ function checkboxInputType(scope, element, attr, ctrl) { /** * @ngdoc directive * @name angular.module.ng.$compileProvider.directive.input + * @restrict E * * @description * HTML input element widget with angular data-binding. Input widget follows HTML5 input types @@ -916,6 +917,7 @@ var ngModelDirective = [function() { /** * @ngdoc directive * @name angular.module.ng.$compileProvider.directive.ng-change + * @restrict E * * @description * Evaluate given expression when user changes the input. diff --git a/src/directive/ngBind.js b/src/directive/ngBind.js index cf9b5688..cc80ac5a 100644 --- a/src/directive/ngBind.js +++ b/src/directive/ngBind.js @@ -158,6 +158,7 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) { /** * @ngdoc directive * @name angular.module.ng.$compileProvider.directive.ng-bind-attr + * @restrict A * * @description * The `ng-bind-attr` attribute specifies that a diff --git a/src/directive/ngSwitch.js b/src/directive/ngSwitch.js index a4f5afad..59c7056e 100644 --- a/src/directive/ngSwitch.js +++ b/src/directive/ngSwitch.js @@ -15,7 +15,7 @@ * ... * * @scope - * @param {*} on expression to match against ng-switch-when. + * @param {*} ng-switch|on expression to match against ng-switch-when. * @paramDescription * On child elments add: * diff --git a/src/directive/script.js b/src/directive/script.js index 98e6394a..4090ae24 100644 --- a/src/directive/script.js +++ b/src/directive/script.js @@ -9,6 +9,7 @@ * template can be used by `ng-include`, `ng-view` or directive templates. * * @restrict E + * @param {'text/ng-template'} type must be set to `'text/ng-template'` * * @example diff --git a/src/directive/select.js b/src/directive/select.js index 0ab35d1c..e5d619b9 100644 --- a/src/directive/select.js +++ b/src/directive/select.js @@ -3,6 +3,7 @@ /** * @ngdoc directive * @name angular.module.ng.$compileProvider.directive.select + * @restrict E * * @description * HTML `SELECT` element with angular data-binding. diff --git a/src/widgets.js b/src/widgets.js deleted file mode 100644 index e69de29b..00000000 -- cgit v1.2.3