Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 1c87901

Browse files
committed
docs(architecture/ts): post-review updates
1 parent 10daf97 commit 1c87901

File tree

5 files changed

+27
-24
lines changed

5 files changed

+27
-24
lines changed

public/docs/_examples/architecture/dart/lib/hero_list_component.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ import 'hero.dart';
44
import 'hero_detail_component.dart';
55
import 'hero_service.dart';
66

7-
// #docregion metadata, providers
7+
// #docregion metadata
88
@Component(
9-
// #enddocregion providers
109
selector: 'hero-list',
1110
templateUrl: 'hero_list_component.html',
1211
directives: const [HeroDetailComponent],
1312
// #docregion providers
14-
providers: const [HeroService])
13+
providers: const [HeroService]
14+
// #enddocregion providers
15+
)
1516
// #docregion class
1617
class HeroListComponent implements OnInit {
17-
// #enddocregion metadata, providers
18+
// #enddocregion metadata
1819
List<Hero> heroes;
1920
Hero selectedHero;
2021
// #docregion ctor
@@ -30,5 +31,5 @@ class HeroListComponent implements OnInit {
3031
void selectHero(Hero hero) {
3132
selectedHero = hero;
3233
}
33-
// #docregion metadata, providers
34+
// #docregion metadata
3435
}

public/docs/_examples/architecture/dart/lib/sales_tax_component.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import 'tax_rate_service.dart';
77
selector: 'sales-tax',
88
template: '''
99
<h2>Sales Tax Calculator</h2>
10-
Amount: <input #amountBox (input)="0" type="number">
10+
Amount: <input #amountBox (change)="0">
1111
1212
<div *ngIf="amountBox.value != ''">
1313
The sales tax is

public/docs/_examples/architecture/ts/app/hero-list.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ import { Hero } from './hero';
44
import { HeroDetailComponent } from './hero-detail.component';
55
import { HeroService } from './hero.service';
66

7-
// #docregion metadata, providers
7+
// #docregion metadata
88
@Component({
9-
// #enddocregion providers
109
selector: 'hero-list',
1110
templateUrl: 'app/hero-list.component.html',
1211
directives: [HeroDetailComponent],
1312
// #docregion providers
1413
providers: [HeroService]
14+
// #enddocregion providers
1515
})
1616
// #docregion class
1717
export class HeroListComponent implements OnInit {
18-
// #enddocregion metadata, providers
18+
// #enddocregion metadata
1919
heroes: Hero[];
2020
selectedHero: Hero;
2121

@@ -28,5 +28,5 @@ export class HeroListComponent implements OnInit {
2828
}
2929

3030
selectHero(hero: Hero) { this.selectedHero = hero; }
31-
// #docregion metadata, providers
31+
// #docregion metadata
3232
}

public/docs/_examples/architecture/ts/app/sales-tax.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { TaxRateService } from './tax-rate.service';
77
selector: 'sales-tax',
88
template: `
99
<h2>Sales Tax Calculator</h2>
10-
Amount: <input #amountBox (input)="0" type="number">
10+
Amount: <input #amountBox (change)="0">
1111
1212
<div *ngIf="amountBox.value">
1313
The sales tax is

public/docs/ts/latest/guide/architecture.jade

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ block modules-are-optional
8181
component class is the kind of thing we'd export from a module.
8282

8383
Most applications have an `AppComponent`. By convention, we'll find it in a file named `!{_app_comp_filename}`.
84-
Look inside such a file and we'll see a declaration like this one.
84+
Look inside such a file and we'll see a declaration such as this one.
8585

8686
+makeExcerpt('app/app.component.ts ()', 'export')
8787

@@ -176,7 +176,7 @@ figure
176176
The class interacts with the view through an API of properties and methods.
177177

178178
<a id="component-code"></a>
179-
A `HeroListComponent`, for example, might have a `heroes` property that returns an !{_array} of heroes
179+
A `HeroListComponent`, for example, might have a `heroes` property that returns !{_an} !{_array} of heroes
180180
that it acquired from a service.
181181
It might have a `selectHero()` method that sets a `selectedHero` property when the user clicks to choose a hero from that list.
182182
The component might be a class like this:
@@ -247,7 +247,7 @@ figure
247247

248248
We tell Angular that `HeroListComponent` is a component by attaching **metadata** to the class.
249249

250-
In !{_Lang}, we attach metadata by using an **!{_decorator}**.
250+
In !{_Lang}, we attach metadata by using !{_a} **!{_decorator}**.
251251
Here's some metadata for `HeroListComponent`:
252252

253253
+makeExcerpt('app/hero-list.component.ts', 'metadata')
@@ -285,13 +285,13 @@ figure
285285
img(src="/resources/images/devguide/architecture/template-metadata-component.png" alt="Metadata" align="left" style="height:200px; margin-left:-40px;margin-right:10px" )
286286

287287
:marked
288-
At runtime, Angular discovers the metadata specified by the `@Component`
289-
annotation. That's how Angular learns how to do "the right thing".
288+
Angular reads the metadata specified by the `@Component`
289+
annotation. That's how Angular learns to do "the right thing".
290290

291291
The template, metadata, and component together describe a view.
292292

293293
We apply other metadata !{_decorator}s in a similar fashion to guide Angular behavior.
294-
`@Injectable`, `@Input`, `@Output`, and `@RouterConfig` are a few of the more popular !{_decorator}s
294+
`@Injectable`, `@Input`, and `@Output` are a few of the more popular !{_decorator}s
295295
we'll master as our Angular knowledge grows.
296296
<br clear="all">
297297
:marked
@@ -341,9 +341,8 @@ figure
341341
as with event binding.
342342

343343
Angular processes *all* data bindings once per JavaScript event cycle,
344-
depth-first from the root of the application component tree.
345-
<!-- PENDING: clarify what "depth-first from the root" really means,
346-
or reassure that they'll learn it soon. -->
344+
from the root of the application component tree down to the leaves.
345+
347346
figure
348347
img(src="/resources/images/devguide/architecture/component-databinding.png" alt="Data Binding" style="float:left; width:300px; margin-left:-40px;margin-right:10px" )
349348
:marked
@@ -381,7 +380,7 @@ figure
381380
:marked
382381
Two *other* kinds of directives exist: _structural_ and _attribute_ directives.
383382

384-
They tend to appear within an element tag like attributes,
383+
They tend to appear within an element tag as attributes do,
385384
sometimes by name but more often as the target of an assignment or a binding.
386385

387386
**Structural** directives alter layout by adding, removing, and replacing elements in DOM.
@@ -423,7 +422,7 @@ block dart-bool
423422
figure
424423
img(src="/resources/images/devguide/architecture/service.png" alt="Service" style="float:left; margin-left:-40px;margin-right:10px" )
425424
:marked
426-
_Services_ is a broad category encompassing any value, function, or feature that our application needs.
425+
_Service_ is a broad category encompassing any value, function, or feature that our application needs.
427426

428427
Almost anything can be a service.
429428
A service is typically a class with a narrow, well-defined purpose. It should do something specific and do it well.
@@ -475,7 +474,7 @@ figure
475474
figure
476475
img(src="/resources/images/devguide/architecture/dependency-injection.png" alt="Service" style="float:left; width:200px; margin-left:-40px;margin-right:10px" )
477476
:marked
478-
Dependency injection is a way to supply a new instance of a class
477+
_Dependency injection_ is a way to supply a new instance of a class
479478
with the fully-formed dependencies it requires. Most dependencies are services.
480479
Angular uses dependency injection to provide new components with the services they need.
481480
<br clear="all">
@@ -512,7 +511,7 @@ figure
512511
+makeExcerpt('app/main.ts', 'bootstrap')
513512

514513
:marked
515-
Alternatively, we might register at a component level:
514+
Alternatively, we might register at a component level, in the providers property of the `@Component` metadata:
516515

517516
+makeExcerpt('app/hero-list.component.ts', 'providers')
518517

@@ -589,6 +588,9 @@ code-example().
589588
:marked
590589
> It displays a price of "42.33" as `$42.33`.
591590

591+
> [**Router**](router.html): Navigate from page to page within the client
592+
application and never leave the browser.
593+
592594
> [**Testing**](testing.html): Angular provides a
593595
[testing library](https://pub.dartlang.org/packages/angular2_testing)
594596
to run unit tests on our application parts as they interact with the Angular framework.

0 commit comments

Comments
 (0)