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

Commit 0016265

Browse files
committed
docs(*): fix headings, links, and wordings
1 parent 09f1325 commit 0016265

File tree

4 files changed

+50
-50
lines changed

4 files changed

+50
-50
lines changed

docs/content/guide/component-router.ngdoc

Lines changed: 27 additions & 27 deletions
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 angular@1.5.x @angular/router@0.2.0
475475
```
476476

477477

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

480480
Just like any Angular 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 Angular application and add the top level App Component.
553553

@@ -559,7 +559,7 @@ Bootstrap the Angular 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 Angular 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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
@description
55

66

7-
# What Is Angular?
7+
# What Is AngularJS?
88

99
AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template
1010
language and lets you extend HTML's syntax to express your application's components clearly and
11-
succinctly. Angular's data binding and dependency injection eliminate much of the code you
11+
succinctly. AngularJS's data binding and dependency injection eliminate much of the code you
1212
would otherwise have to write. And it all happens within the browser, making it
1313
an ideal partner with any server technology.
1414

15-
Angular is what HTML would have been, had it been designed for applications. HTML is a great
15+
AngularJS is what HTML would have been, had it been designed for applications. HTML is a great
1616
declarative language for static documents. It does not contain much in the way of creating
1717
applications, and as a result building web applications is an exercise in *what do I have to do
1818
to trick the browser into doing what I want?*
@@ -26,8 +26,8 @@ The impedance mismatch between dynamic applications and static documents is ofte
2626
app specific. E.g., `durandal`, `ember`, etc.
2727

2828

29-
Angular takes another approach. It attempts to minimize the impedance mismatch between document
30-
centric HTML and what an application needs by creating new HTML constructs. Angular teaches the
29+
AngularJS takes another approach. It attempts to minimize the impedance mismatch between document
30+
centric HTML and what an application needs by creating new HTML constructs. AngularJS teaches the
3131
browser new syntax through a construct we call *directives*. Examples include:
3232

3333
* Data binding, as in `{{}}`.
@@ -40,33 +40,33 @@ browser new syntax through a construct we call *directives*. Examples include:
4040

4141
## A complete client-side solution
4242

43-
Angular is not a single piece in the overall puzzle of building the client-side of a web
43+
AngularJS is not a single piece in the overall puzzle of building the client-side of a web
4444
application. It handles all of the DOM and AJAX glue code you once wrote by hand and puts it in a
45-
well-defined structure. This makes Angular opinionated about how a CRUD (Create, Read, Update, Delete)
46-
application should be built. But while it is opinionated, it also tries to make sure that its opinion
47-
is just a starting point you can easily change. Angular comes with the following out-of-the-box:
45+
well-defined structure. This makes AngularJS opinionated about how a CRUD (Create, Read, Update, Delete)
46+
application should be built. But while it is opinionated, it also tries to make sure that its opinion
47+
is just a starting point you can easily change. AngularJS comes with the following out-of-the-box:
4848

4949
* Everything you need to build a CRUD app in a cohesive set: Data-binding, basic templating
5050
directives, form validation, routing, deep-linking, reusable components and dependency injection.
5151
* Testability story: Unit-testing, end-to-end testing, mocks and test harnesses.
5252
* Seed application with directory layout and test scripts as a starting point.
5353

5454

55-
## Angular's sweet spot
55+
## AngularJS's sweet spot
5656

57-
Angular simplifies application development by presenting a higher level of abstraction to the
57+
AngularJS simplifies application development by presenting a higher level of abstraction to the
5858
developer. Like any abstraction, it comes at a cost of flexibility. In other words, not every app
59-
is a good fit for Angular. Angular was built with the CRUD application in mind. Luckily CRUD
60-
applications represent the majority of web applications. To understand what Angular is
61-
good at, though, it helps to understand when an app is not a good fit for Angular.
59+
is a good fit for AngularJS. AngularJS was built with the CRUD application in mind. Luckily CRUD
60+
applications represent the majority of web applications. To understand what AngularJS is
61+
good at, though, it helps to understand when an app is not a good fit for AngularJS.
6262

6363
Games and GUI editors are examples of applications with intensive and tricky DOM manipulation.
64-
These kinds of apps are different from CRUD apps, and as a result are probably not a good fit for Angular.
64+
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 Angular
67+
## The Zen of AngularJS
6868

69-
Angular is built around the belief that declarative code is better than imperative when it comes
69+
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
7171
expressing business logic.
7272

@@ -83,7 +83,7 @@ expressing business logic.
8383

8484

8585

86-
Angular frees you from the following pains:
86+
AngularJS frees you from the following pains:
8787

8888
* **Registering callbacks:** Registering callbacks clutters your code, making it hard to see the
8989
forest for the trees. Removing common boilerplate code such as callbacks is a good thing. It
@@ -92,16 +92,16 @@ Angular frees you from the following pains:
9292
* **Manipulating HTML DOM programmatically:** Manipulating HTML DOM is a cornerstone of AJAX
9393
applications, but it's cumbersome and error-prone. By declaratively describing how the UI
9494
should change as your application state changes, you are freed from low-level DOM manipulation
95-
tasks. Most applications written with Angular never have to programmatically manipulate the
95+
tasks. Most applications written with AngularJS never have to programmatically manipulate the
9696
DOM, although you can if you want to.
9797
* **Marshaling data to and from the UI:** CRUD operations make up the majority of AJAX
9898
applications' tasks. The flow of marshaling data from the server to an internal object to an HTML
9999
form, allowing users to modify the form, validating the form, displaying validation errors,
100100
returning to an internal model, and then back to the server, creates a lot of boilerplate
101-
code. Angular eliminates almost all of this boilerplate, leaving code that describes the
101+
code. AngularJS eliminates almost all of this boilerplate, leaving code that describes the
102102
overall flow of the application rather than all of the implementation details.
103103
* **Writing tons of initialization code just to get started:** Typically you need to write a lot
104-
of plumbing just to get a basic "Hello World" AJAX app working. With Angular you can bootstrap
104+
of plumbing just to get a basic "Hello World" AJAX app working. With AngularJS you can bootstrap
105105
your app easily using services, which are auto-injected into your application in a
106106
[Guice](https://github.com/google/guice)-like dependency-injection style. This allows you
107107
to get started developing features quickly. As a bonus, you get full control over the

0 commit comments

Comments
 (0)