Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 62afb62

Browse files
committed
docs(*): add / correct @-tags; fix headlines; add info
- add / correct `@param`, `@restrict`, `@element`, `@priorìty` to directives - use `@animations` instead of manual headings - fix more incorrect h1 headings - fix incorrectly indented `<examples>` - add some info to $templateCache and $templateRequest
1 parent 1eaf4ab commit 62afb62

21 files changed

+257
-199
lines changed

docs/content/guide/animations.ngdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ triggered:
232232
| {@link ng.directive:ngClass#animations ngClassEven / ngClassOdd} | add and remove |
233233
| {@link ng.directive:ngHide#animations ngHide} | add and remove (the `ng-hide` class) |
234234
| {@link ng.directive:ngShow#animations ngShow} | add and remove (the `ng-hide` class) |
235-
| {@link ng.directive:ngModel#animation-hooks ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) |
236-
| {@link ng.directive:form#animation-hooks form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) |
235+
| {@link ng.directive:ngModel#animations ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) |
236+
| {@link ng.directive:form#animations form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) |
237237
| {@link module:ngMessages#animations ngMessages} | add and remove (the `ng-active`/`ng-inactive` classes) |
238238

239239
For a full breakdown of the steps involved during each animation event, refer to the

src/Angular.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,6 +1610,10 @@ var isAutoBootstrapAllowed = allowAutoBootstrap(window.document);
16101610
* document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`
16111611
* would not be resolved to `3`.
16121612
*
1613+
* @example
1614+
*
1615+
* ### Simple Usage
1616+
*
16131617
* `ngApp` is the easiest, and most common way to bootstrap an application.
16141618
*
16151619
<example module="ngAppDemo" name="ng-app">
@@ -1626,6 +1630,10 @@ var isAutoBootstrapAllowed = allowAutoBootstrap(window.document);
16261630
</file>
16271631
</example>
16281632
*
1633+
* @example
1634+
*
1635+
* ### With `ngStrictDi`
1636+
*
16291637
* Using `ngStrictDi`, you would see something like this:
16301638
*
16311639
<example ng-app-included="true" name="strict-di">

src/ng/cacheFactory.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ function $CacheFactoryProvider() {
106106
*
107107
* @description
108108
* A cache object used to store and retrieve data, primarily used by
109-
* {@link $http $http} and the {@link ng.directive:script script} directive to cache
110-
* templates and other data.
109+
* {@link $templateRequest $templateRequest} and the {@link ng.directive:script script}
110+
* directive to cache templates and other data.
111111
*
112112
* ```js
113113
* angular.module('superCache')
@@ -360,9 +360,12 @@ function $CacheFactoryProvider() {
360360
* @this
361361
*
362362
* @description
363+
* `$templateCache` is a {@link $cacheFactory.Cache Cache object} created by the
364+
* {@link ng.$cacheFactory $cacheFactory}.
365+
*
363366
* The first time a template is used, it is loaded in the template cache for quick retrieval. You
364-
* can load templates directly into the cache in a `script` tag, or by consuming the
365-
* `$templateCache` service directly.
367+
* can load templates directly into the cache in a `script` tag, by using {@link $templateRequest},
368+
* or by consuming the `$templateCache` service directly.
366369
*
367370
* Adding via the `script` tag:
368371
*
@@ -373,8 +376,8 @@ function $CacheFactoryProvider() {
373376
* ```
374377
*
375378
* **Note:** the `script` tag containing the template does not need to be included in the `head` of
376-
* the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE,
377-
* element with ng-app attribute), otherwise the template will be ignored.
379+
* the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (e.g.
380+
* element with {@link ngApp} attribute), otherwise the template will be ignored.
378381
*
379382
* Adding via the `$templateCache` service:
380383
*
@@ -397,8 +400,6 @@ function $CacheFactoryProvider() {
397400
* $templateCache.get('templateId.html')
398401
* ```
399402
*
400-
* See {@link ng.$cacheFactory $cacheFactory}.
401-
*
402403
*/
403404
function $TemplateCacheProvider() {
404405
this.$get = ['$cacheFactory', function($cacheFactory) {

src/ng/directive/form.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,7 @@ addSetValidityMethod({
415415
* submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`
416416
* to have access to the updated model.
417417
*
418-
* ## Animation Hooks
419-
*
418+
* @animations
420419
* Animations in ngForm are triggered when any of the associated CSS classes are added and removed.
421420
* These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any
422421
* other validations that are performed within the form. Animations in ngForm are similar to how

src/ng/directive/input.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,6 +2082,8 @@ var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
20822082
/**
20832083
* @ngdoc directive
20842084
* @name ngValue
2085+
* @restrict A
2086+
* @priority 100
20852087
*
20862088
* @description
20872089
* Binds the given expression to the value of the element.
@@ -2094,8 +2096,8 @@ var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
20942096
* It can also be used to achieve one-way binding of a given expression to an input element
20952097
* such as an `input[text]` or a `textarea`, when that element does not use ngModel.
20962098
*
2097-
* @element input
2098-
* @param {string=} ngValue angular expression, whose value will be bound to the `value` attribute
2099+
* @element ANY
2100+
* @param {string=} ngValue AngularJS expression, whose value will be bound to the `value` attribute
20992101
* and `value` property of the element.
21002102
*
21012103
* @example

src/ng/directive/ngChange.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/**
44
* @ngdoc directive
55
* @name ngChange
6+
* @restrict A
67
*
78
* @description
89
* Evaluate the given expression when the user changes the input.
@@ -21,7 +22,7 @@
2122
*
2223
* Note, this directive requires `ngModel` to be present.
2324
*
24-
* @element input
25+
* @element ANY
2526
* @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change
2627
* in input value.
2728
*

src/ng/directive/ngClass.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ function classDirective(name, selector) {
186186
* @ngdoc directive
187187
* @name ngClass
188188
* @restrict AC
189+
* @element ANY
189190
*
190191
* @description
191192
* The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding
@@ -221,14 +222,21 @@ function classDirective(name, selector) {
221222
* | {@link ng.$animate#addClass addClass} | just before the class is applied to the element |
222223
* | {@link ng.$animate#removeClass removeClass} | just before the class is removed from the element |
223224
*
224-
* @element ANY
225+
* ### ngClass and pre-existing CSS3 Transitions/Animations
226+
The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.
227+
Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder
228+
any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure
229+
to view the step by step details of {@link $animate#addClass $animate.addClass} and
230+
{@link $animate#removeClass $animate.removeClass}.
231+
*
225232
* @param {expression} ngClass {@link guide/expression Expression} to eval. The result
226233
* of the evaluation can be a string representing space delimited class
227234
* names, an array, or a map of class names to boolean values. In the case of a map, the
228235
* names of the properties whose values are truthy will be added as css classes to the
229236
* element.
230237
*
231-
* @example Example that demonstrates basic bindings via ngClass directive.
238+
* @example
239+
* ### Basic
232240
<example name="ng-class">
233241
<file name="index.html">
234242
<p ng-class="{strike: deleted, bold: important, 'has-error': error}">Map Syntax Example</p>
@@ -318,7 +326,8 @@ function classDirective(name, selector) {
318326
</file>
319327
</example>
320328
321-
## Animations
329+
@example
330+
### Animations
322331
323332
The example below demonstrates how to perform animations using ngClass.
324333
@@ -356,14 +365,6 @@ function classDirective(name, selector) {
356365
});
357366
</file>
358367
</example>
359-
360-
361-
## ngClass and pre-existing CSS3 Transitions/Animations
362-
The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.
363-
Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder
364-
any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure
365-
to view the step by step details of {@link $animate#addClass $animate.addClass} and
366-
{@link $animate#removeClass $animate.removeClass}.
367368
*/
368369
var ngClassDirective = classDirective('', true);
369370

0 commit comments

Comments
 (0)