@@ -81,7 +81,7 @@ block modules-are-optional
81
81
component class is the kind of thing we'd export from a module.
82
82
83
83
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.
85
85
86
86
+ makeExcerpt('app/app.component.ts ()' , 'export' )
87
87
@@ -176,7 +176,7 @@ figure
176
176
The class interacts with the view through an API of properties and methods.
177
177
178
178
<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
180
180
that it acquired from a service.
181
181
It might have a `selectHero()` method that sets a `selectedHero` property when the user clicks to choose a hero from that list.
182
182
The component might be a class like this:
@@ -247,7 +247,7 @@ figure
247
247
248
248
We tell Angular that `HeroListComponent` is a component by attaching **metadata** to the class.
249
249
250
- In !{_Lang}, we attach metadata by using an **!{_decorator}**.
250
+ In !{_Lang}, we attach metadata by using !{_a} **!{_decorator}**.
251
251
Here's some metadata for `HeroListComponent`:
252
252
253
253
+ makeExcerpt('app/hero-list.component.ts' , 'metadata' )
@@ -285,13 +285,13 @@ figure
285
285
img( src ="/resources/images/devguide/architecture/template-metadata-component.png" alt ="Metadata" align ="left" style ="height:200px; margin-left:-40px;margin-right:10px" )
286
286
287
287
: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".
290
290
291
291
The template, metadata, and component together describe a view.
292
292
293
293
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
295
295
we'll master as our Angular knowledge grows.
296
296
<br clear =" all" >
297
297
:marked
@@ -341,9 +341,8 @@ figure
341
341
as with event binding.
342
342
343
343
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
+
347
346
figure
348
347
img( src ="/resources/images/devguide/architecture/component-databinding.png" alt ="Data Binding" style ="float:left; width:300px; margin-left:-40px;margin-right:10px" )
349
348
:marked
@@ -381,7 +380,7 @@ figure
381
380
:marked
382
381
Two *other* kinds of directives exist: _structural_ and _attribute_ directives.
383
382
384
- They tend to appear within an element tag like attributes,
383
+ They tend to appear within an element tag as attributes do ,
385
384
sometimes by name but more often as the target of an assignment or a binding.
386
385
387
386
**Structural** directives alter layout by adding, removing, and replacing elements in DOM.
@@ -423,7 +422,7 @@ block dart-bool
423
422
figure
424
423
img( src ="/resources/images/devguide/architecture/service.png" alt ="Service" style ="float:left; margin-left:-40px;margin-right:10px" )
425
424
: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.
427
426
428
427
Almost anything can be a service.
429
428
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
475
474
figure
476
475
img( src ="/resources/images/devguide/architecture/dependency-injection.png" alt ="Service" style ="float:left; width:200px; margin-left:-40px;margin-right:10px" )
477
476
: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
479
478
with the fully-formed dependencies it requires. Most dependencies are services.
480
479
Angular uses dependency injection to provide new components with the services they need.
481
480
<br clear =" all" >
@@ -512,7 +511,7 @@ figure
512
511
+ makeExcerpt('app/main.ts' , 'bootstrap' )
513
512
514
513
: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 :
516
515
517
516
+ makeExcerpt('app/hero-list.component.ts' , 'providers' )
518
517
@@ -589,6 +588,9 @@ code-example().
589
588
:marked
590
589
> It displays a price of "42.33" as `$42.33`.
591
590
591
+ > [**Router**](router.html): Navigate from page to page within the client
592
+ application and never leave the browser.
593
+
592
594
> [**Testing**](testing.html): Angular provides a
593
595
[testing library](https://pub.dartlang.org/packages/angular2_testing)
594
596
to run unit tests on our application parts as they interact with the Angular framework.
0 commit comments