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

Commit 40c4990

Browse files
committed
docs(*): fix headings and links
1 parent 7300a53 commit 40c4990

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

docs/content/guide/component-router.ngdoc

+27-27
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ The result is that we end up with a hierarchy of **Routing Components** rendered
138138
![Component Hierarchy](img/guide/component-hierarchy.svg)
139139

140140

141-
# Example Heroes App
141+
## Example Heroes App
142142

143143
You can see the complete application running below.
144144

@@ -459,12 +459,12 @@ You can see the complete application running below.
459459
</example>
460460

461461

462-
# Getting Started
462+
### Getting Started
463463

464464
In the following sections we will step through building this application. The finished application has views
465465
to display list and detail views of Heroes and Crises.
466466

467-
## Install the libraries
467+
#### Install the libraries
468468

469469
It is easier to use [Yarn](https://yarnpkg.com) or [npm](https://www.npmjs.com) to install the
470470
**Component Router** module. For this guide we will also install AngularJS itself via Yarn:
@@ -475,7 +475,7 @@ yarn add [email protected] @angular/[email protected]
475475
```
476476

477477

478-
## Load the scripts
478+
#### Load the scripts
479479

480480
Just like any AngularJS application, we load the JavaScript files into our `index.html`:
481481

@@ -494,7 +494,7 @@ You also need to include ES6 shims for browsers that do not support ES6 code (In
494494
<script src="https://unpkg.com/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
495495
```
496496

497-
## Create the `app` module
497+
#### Create the `app` module
498498

499499
In the app.js file, create the main application module `app` which depends on the `ngComponentRouter`
500500
module, which is provided by the **Component Router** script.
@@ -547,7 +547,7 @@ must have a base URL.
547547
...
548548
```
549549

550-
## Bootstrap AngularJS
550+
#### Bootstrap AngularJS
551551

552552
Bootstrap the AngularJS application and add the top level App Component.
553553

@@ -559,7 +559,7 @@ Bootstrap the AngularJS application and add the top level App Component.
559559
```
560560

561561

562-
# Implementing the AppComponent
562+
### Implementing the AppComponent
563563

564564
In the previous section we have created a single top level **App Component**. Let's now create some more
565565
**Routing Components** and wire up **Route Config** for those. We start with a Heroes Feature, which
@@ -577,7 +577,7 @@ We are going to have a `Heroes` Component for the Heroes feature of our applicat
577577
and `HeroDetail` **Components** that will actually display the two different views.
578578

579579

580-
## App Component
580+
#### App Component
581581

582582
Configure the **App Component** with a template and **Route Config**:
583583

@@ -598,7 +598,7 @@ Configure the **App Component** with a template and **Route Config**:
598598
The **App Component** has an `<ng-outlet>` directive in its template. This is where the child **Components**
599599
of this view will be rendered.
600600

601-
### ngLink
601+
#### ngLink
602602

603603
We have used the `ng-link` directive to create a link to navigate to the Heroes Component. By using this
604604
directive we don't need to know what the actual URL will be. We can let the Router generate that for us.
@@ -607,7 +607,7 @@ We have included a link to the Crisis Center but have not included the `ng-link`
607607
implemented the CrisisCenter component.
608608

609609

610-
### Non-terminal Routes
610+
#### Non-terminal Routes
611611

612612
We need to tell the **Router** that the `Heroes` **Route Definition** is **non-terminal**, that it should
613613
continue to match **Routes** in its child **Components**. We do this by adding a **continuation ellipsis
@@ -616,14 +616,14 @@ Without the **continuation ellipsis** the `HeroList` **Route** will never be mat
616616
stop at the `Heroes` **Routing Component** and not try to match the rest of the URL.
617617

618618

619-
## Heroes Feature
619+
### Heroes Feature
620620

621621
Now we can implement our Heroes Feature which consists of three **Components**: `Heroes`, `HeroList` and
622622
`HeroDetail`. The `Heroes` **Routing Component** simply provides a template containing the {@link ngOutlet}
623623
directive and a **Route Config** that defines a set of child **Routes** which delegate through to the
624624
`HeroList` and `HeroDetail` **Components**.
625625

626-
## HeroesComponent
626+
### HeroesComponent
627627

628628
Create a new file `heroes.js`, which defines a new AngularJS module for the **Components** of this feature
629629
and registers the Heroes **Component**.
@@ -651,20 +651,20 @@ and also to add the module as a dependency of the `app` module:
651651
angular.module('app', ['ngComponentRouter', 'heroes'])
652652
```
653653

654-
### Use As Default
654+
#### Use As Default
655655
The `useAsDefault` property on the `HeroList` **Route Definition**, indicates that if no other **Route
656656
Definition** matches the URL, then this **Route Definition** should be used by default.
657657

658-
### Route Parameters
658+
#### Route Parameters
659659
The `HeroDetail` Route has a named parameter (`id`), indicated by prefixing the URL segment with a colon,
660660
as part of its `path` property. The **Router** will match anything in this segment and make that value
661661
available to the HeroDetail **Component**.
662662

663-
### Terminal Routes
663+
#### Terminal Routes
664664
Both the Routes in the `HeroesComponent` are terminal, i.e. their routes do not end with `...`. This is
665665
because the `HeroList` and `HeroDetail` will not contain any child routes.
666666

667-
### Route Names
667+
#### Route Names
668668
**What is the difference between the `name` and `component` properties on a Route Definition?**
669669

670670
The `component` property in a **Route Definition** defines the **Component** directive that will be rendered
@@ -676,7 +676,7 @@ The `name` property is used to reference the **Route Definition** when generatin
676676
that has the `name` property of `"Heroes"`.
677677

678678

679-
## HeroList Component
679+
### HeroList Component
680680

681681
The HeroList **Component** is the first component in the application that actually contains significant
682682
functionality. It loads up a list of heroes from a `heroService` and displays them using `ng-repeat`.
@@ -705,7 +705,7 @@ The template iterates through each `hero` object of the array in the `$ctrl.hero
705705
the `$ctrl` property on the scope of the template.*
706706

707707

708-
## HeroService
708+
### HeroService
709709

710710
Our HeroService simulates requesting a list of heroes from a server. In a real application this would be
711711
making an actual server request, perhaps over HTTP.
@@ -735,7 +735,7 @@ Note that both the `getHeroes()` and `getHero(id)` methods return a promise for
735735
in real-life we would have to wait for the server to respond with the data.
736736

737737

738-
## Router Lifecycle Hooks
738+
### Router Lifecycle Hooks
739739

740740
**How do I know when my Component is active?**
741741

@@ -780,7 +780,7 @@ By returning a promise for the list of heroes from `$routerOnActivate()` we can
780780
Route until the heroes have arrived successfully. This is similar to how a `resolve` works in {@link ngRoute}.
781781

782782

783-
## Route Parameters
783+
### Route Parameters
784784

785785
**How do I access parameters for the current route?**
786786

@@ -811,7 +811,7 @@ by the **Router**. In this code it is used to identify a specific Hero to retrie
811811
This hero is then attached to the **Component** so that it can be accessed in the template.
812812

813813

814-
## Access to the Current Router
814+
### Access to the Current Router
815815

816816
**How do I get hold of the current router for my component?**
817817

@@ -882,7 +882,7 @@ Other options for generating this navigation are:
882882
```
883883
this form gives you the possibility of caching the instruction, but is more verbose.
884884

885-
### Absolute vs Relative Navigation
885+
#### Absolute vs Relative Navigation
886886

887887
**Why not use `$rootRouter` to do the navigation?**
888888

@@ -894,7 +894,7 @@ to the `HeroListComponent` with the `$rootRouter`, we would have to provide a co
894894
`['App','Heroes','HeroList']`.
895895

896896

897-
## Extra Parameters
897+
### Extra Parameters
898898

899899
We can also pass additional optional parameters to routes, which get encoded into the URL and are again
900900
available to the `$routerOnActivate(next, previous)` hook. If we pass the current `id` from the
@@ -936,7 +936,7 @@ Finally, we can use this information to highlight the current hero in the templa
936936
</div>
937937
```
938938

939-
## Crisis Center
939+
### Crisis Center
940940

941941
Let's implement the Crisis Center feature, which displays a list if crises that need to be dealt with by a hero.
942942
The detailed crisis view has an additional feature where it blocks you from navigating if you have not saved
@@ -951,7 +951,7 @@ changes to the crisis being edited.
951951
![Crisis Detail View](img/guide/crisis-detail.png)
952952

953953

954-
## Crisis Feature
954+
### Crisis Feature
955955

956956
This feature is very similar to the Heroes feature. It contains the following **Components**:
957957

@@ -962,7 +962,7 @@ This feature is very similar to the Heroes feature. It contains the following **
962962
CrisisService and CrisisListComponent are basically the same as HeroService and HeroListComponent
963963
respectively.
964964

965-
## Navigation Control Hooks
965+
### Navigation Control Hooks
966966

967967
**How do I prevent navigation from occurring?**
968968

@@ -979,7 +979,7 @@ can complete, all the **Components** must agree that they can be deactivated or
979979
The **Router** will call the `$routerCanDeactivate` and `$canActivate` hooks, if they are provided. If any
980980
of the hooks resolve to `false` then the navigation is cancelled.
981981

982-
### Dialog Box Service
982+
#### Dialog Box Service
983983

984984
We can implement a very simple dialog box that will prompt the user whether they are happy to lose changes they
985985
have made. The result of the prompt is a promise that can be used in a `$routerCanDeactivate` hook.

docs/content/guide/component.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ angular.module('docsTabsExample', [])
445445
</example>
446446

447447

448-
# Unit-testing Component Controllers
448+
## Unit-testing Component Controllers
449449

450450
The easiest way to unit-test a component controller is by using the
451451
{@link ngMock.$componentController $componentController} that is included in {@link ngMock}. The

docs/content/guide/di.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ into `run` blocks.
3939
However, only those that have been **registered beforehand** can be injected. This is different
4040
from services, where the order of registration does not matter.
4141

42-
See {@link module#module-loading-dependencies Modules} for more details about `run` and `config`
42+
See {@link module#module-loading Modules} for more details about `run` and `config`
4343
blocks and {@link guide/providers Providers} for more information about the different provider
4444
types.
4545

docs/content/guide/introduction.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Games and GUI editors are examples of applications with intensive and tricky DOM
6464
These kinds of apps are different from CRUD apps, and as a result are probably not a good fit for AngularJS.
6565
In these cases it may be better to use a library with a lower level of abstraction, such as `jQuery`.
6666

67-
# The Zen of AngularJS
67+
## The Zen of AngularJS
6868

6969
AngularJS is built around the belief that declarative code is better than imperative when it comes
7070
to building UIs and wiring software components together, while imperative code is excellent for

0 commit comments

Comments
 (0)