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

Commit e5c6174

Browse files
committed
docs(*): fix heading levels; use @example instead of headings
This ensures the doc-gen creates correct headlines and table of contents entries.
1 parent f05f548 commit e5c6174

File tree

9 files changed

+35
-35
lines changed

9 files changed

+35
-35
lines changed

Diff for: src/auto/injector.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ function annotate(fn, strictDi, name) {
264264
* function is invoked. There are three ways in which the function can be annotated with the needed
265265
* dependencies.
266266
*
267-
* ## Argument names
267+
* #### Argument names
268268
*
269269
* The simplest form is to extract the dependencies from the arguments of the function. This is done
270270
* by converting the function into a string using `toString()` method and extracting the argument
@@ -284,7 +284,7 @@ function annotate(fn, strictDi, name) {
284284
* This method does not work with code minification / obfuscation. For this reason the following
285285
* annotation strategies are supported.
286286
*
287-
* ## The `$inject` property
287+
* #### The `$inject` property
288288
*
289289
* If a function has an `$inject` property and its value is an array of strings, then the strings
290290
* represent names of services to be injected into the function.
@@ -300,7 +300,7 @@ function annotate(fn, strictDi, name) {
300300
* expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
301301
* ```
302302
*
303-
* ## The array notation
303+
* #### The array notation
304304
*
305305
* It is often desirable to inline Injected functions and that's when setting the `$inject` property
306306
* is very inconvenient. In these situations using the array notation to specify the dependencies in
@@ -360,8 +360,7 @@ function annotate(fn, strictDi, name) {
360360
* You can use {@link $injector#modules `$injector.modules`} to check whether a module has been loaded
361361
* into the injector, which may indicate whether the script has been executed already.
362362
*
363-
* ## Example
364-
*
363+
* @example
365364
* Here is an example of loading a bundle of modules, with a utility method called `getScript`:
366365
*
367366
* ```javascript

Diff for: src/ng/directive/ngModel.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ NgModelController.prototype = {
472472
* input which may have such events pending. This is important in order to make sure that the
473473
* input field will be updated with the new model value and any pending operations are cancelled.
474474
*
475+
* @example
475476
* <example name="ng-model-cancel-update" module="cancel-update-example">
476477
* <file name="app.js">
477478
* angular.module('cancel-update-example', [])
@@ -906,8 +907,7 @@ NgModelController.prototype = {
906907
* This function can be used when the `$viewValue` or the rendered DOM value are not correctly
907908
* formatted and the `$modelValue` must be run through the `$formatters` again.
908909
*
909-
* #### Example
910-
*
910+
* @example
911911
* Consider a text input with an autocomplete list (for fruit), where the items are
912912
* objects with a name and an id.
913913
* A user enters `ap` and then selects `Apricot` from the list.

Diff for: src/ng/directive/ngNonBindable.js

+13-15
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,29 @@
55
* @name ngNonBindable
66
* @restrict AC
77
* @priority 1000
8+
* @element ANY
89
*
910
* @description
1011
* The `ngNonBindable` directive tells AngularJS not to compile or bind the contents of the current
1112
* DOM element. This is useful if the element contains what appears to be AngularJS directives and
1213
* bindings but which should be ignored by AngularJS. This could be the case if you have a site that
1314
* displays snippets of code, for instance.
1415
*
15-
* @element ANY
16-
*
1716
* @example
1817
* In this example there are two locations where a simple interpolation binding (`{{}}`) is present,
1918
* but the one wrapped in `ngNonBindable` is left alone.
2019
*
21-
* @example
22-
<example name="ng-non-bindable">
23-
<file name="index.html">
24-
<div>Normal: {{1 + 2}}</div>
25-
<div ng-non-bindable>Ignored: {{1 + 2}}</div>
26-
</file>
27-
<file name="protractor.js" type="protractor">
28-
it('should check ng-non-bindable', function() {
29-
expect(element(by.binding('1 + 2')).getText()).toContain('3');
30-
expect(element.all(by.css('div')).last().getText()).toMatch(/1 \+ 2/);
31-
});
32-
</file>
33-
</example>
20+
<example name="ng-non-bindable">
21+
<file name="index.html">
22+
<div>Normal: {{1 + 2}}</div>
23+
<div ng-non-bindable>Ignored: {{1 + 2}}</div>
24+
</file>
25+
<file name="protractor.js" type="protractor">
26+
it('should check ng-non-bindable', function() {
27+
expect(element(by.binding('1 + 2')).getText()).toContain('3');
28+
expect(element.all(by.css('div')).last().getText()).toMatch(/1 \+ 2/);
29+
});
30+
</file>
31+
</example>
3432
*/
3533
var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });

Diff for: src/ng/directive/ngRepeat.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* </div>
3131
*
3232
*
33-
* # Iterating over object properties
33+
* ## Iterating over object properties
3434
*
3535
* It is possible to get `ngRepeat` to iterate over the properties of an object using the following
3636
* syntax:
@@ -60,7 +60,7 @@
6060
* or implement a `$watch` on the object yourself.
6161
*
6262
*
63-
* # Tracking and Duplicates
63+
* ## Tracking and Duplicates
6464
*
6565
* `ngRepeat` uses {@link $rootScope.Scope#$watchCollection $watchCollection} to detect changes in
6666
* the collection. When a change happens, `ngRepeat` then makes the corresponding changes to the DOM:
@@ -140,7 +140,7 @@
140140
* ```
141141
*
142142
*
143-
* # Special repeat start and end points
143+
* ## Special repeat start and end points
144144
* To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending
145145
* the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.
146146
* The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on)
@@ -249,7 +249,7 @@
249249
* @example
250250
* This example uses `ngRepeat` to display a list of people. A filter is used to restrict the displayed
251251
* results by name or by age. New (entering) and removed (leaving) items are animated.
252-
<example module="ngRepeat" name="ngRepeat" deps="angular-animate.js" animations="true" name="ng-repeat">
252+
<example module="ngRepeat" name="ngRepeat" deps="angular-animate.js" animations="true">
253253
<file name="index.html">
254254
<div ng-controller="repeatController">
255255
I have {{friends.length}} friends. They are:

Diff for: src/ng/directive/select.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ var SelectController =
600600
* </file>
601601
*</example>
602602
*
603+
* @example
603604
* ### Using `ngRepeat` to generate `select` options
604605
* <example name="select-ngrepeat" module="ngrepeatSelect">
605606
* <file name="index.html">
@@ -629,6 +630,7 @@ var SelectController =
629630
* </file>
630631
*</example>
631632
*
633+
* @example
632634
* ### Using `ngValue` to bind the model to an array of objects
633635
* <example name="select-ngvalue" module="ngvalueSelect">
634636
* <file name="index.html">
@@ -661,6 +663,7 @@ var SelectController =
661663
* </file>
662664
*</example>
663665
*
666+
* @example
664667
* ### Using `select` with `ngOptions` and setting a default value
665668
* See the {@link ngOptions ngOptions documentation} for more `ngOptions` usage examples.
666669
*
@@ -692,7 +695,7 @@ var SelectController =
692695
* </file>
693696
*</example>
694697
*
695-
*
698+
* @example
696699
* ### Binding `select` to a non-string value via `ngModel` parsing / formatting
697700
*
698701
* <example name="select-with-non-string-options" module="nonStringSelect">

Diff for: src/ng/rootScope.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ function $RootScopeProvider() {
318318
*
319319
*
320320
*
321-
* #### Example
321+
* @example
322322
* ```js
323323
// let's assume that scope was dependency injected as the $rootScope
324324
var scope = $rootScope;
@@ -541,7 +541,7 @@ function $RootScopeProvider() {
541541
* adding, removing, and moving items belonging to an object or array.
542542
*
543543
*
544-
* #### Example
544+
* @example
545545
* ```js
546546
$scope.names = ['igor', 'matias', 'misko', 'james'];
547547
$scope.dataCount = 4;
@@ -743,7 +743,7 @@ function $RootScopeProvider() {
743743
*
744744
* In unit tests, you may need to call `$digest()` to simulate the scope life cycle.
745745
*
746-
* #### Example
746+
* @example
747747
* ```js
748748
var scope = ...;
749749
scope.name = 'misko';
@@ -972,7 +972,7 @@ function $RootScopeProvider() {
972972
* the expression are propagated (uncaught). This is useful when evaluating AngularJS
973973
* expressions.
974974
*
975-
* #### Example
975+
* @example
976976
* ```js
977977
var scope = ng.$rootScope.Scope();
978978
scope.a = 1;

Diff for: src/ngAnimate/animateCss.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var ANIMATE_TIMER_KEY = '$$animateCss';
1818
* Note that only browsers that support CSS transitions and/or keyframe animations are capable of
1919
* rendering animations triggered via `$animateCss` (bad news for IE9 and lower).
2020
*
21-
* ## Usage
21+
* ## General Use
2222
* Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that
2323
* is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however,
2424
* any automatic control over cancelling animations and/or preventing animations from being run on

Diff for: src/ngMock/angular-mocks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2472,7 +2472,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
24722472
*
24732473
* Afterwards, bootstrap your app with this new module.
24742474
*
2475-
* ## Example
2475+
* @example
24762476
* <example name="httpbackend-e2e-testing" module="myAppE2E" deps="angular-mocks.js">
24772477
* <file name="app.js">
24782478
* var myApp = angular.module('myApp', []);

Diff for: src/ngRoute/route.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var noop;
1717
* The `ngRoute` module provides routing and deeplinking services and directives for AngularJS apps.
1818
*
1919
* ## Example
20-
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
20+
* See {@link ngRoute.$route#examples $route} for an example of configuring and using `ngRoute`.
2121
*
2222
*/
2323
/* global -ngRouteModule */
@@ -43,7 +43,7 @@ var isEagerInstantiationEnabled;
4343
* Used for configuring routes.
4444
*
4545
* ## Example
46-
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
46+
* See {@link ngRoute.$route#examples $route} for an example of configuring and using `ngRoute`.
4747
*
4848
* ## Dependencies
4949
* Requires the {@link ngRoute `ngRoute`} module to be installed.

0 commit comments

Comments
 (0)