diff --git a/aio/content/cookbook/ajs-quick-reference.md b/aio/content/guide/ajs-quick-reference.md
similarity index 99%
rename from aio/content/cookbook/ajs-quick-reference.md
rename to aio/content/guide/ajs-quick-reference.md
index eb69ea22f4..792e332085 100644
--- a/aio/content/cookbook/ajs-quick-reference.md
+++ b/aio/content/guide/ajs-quick-reference.md
@@ -896,7 +896,7 @@ For more information on pipes, see [Pipes](../guide/pipes.html).
Displays the collection in the order specified by the expression.
- In this example, the movie title orders the movieList.
+ In this example, the movie title orders the `movieList`.
diff --git a/aio/content/cookbook/aot-compiler.md b/aio/content/guide/aot-compiler.md
similarity index 99%
rename from aio/content/cookbook/aot-compiler.md
rename to aio/content/guide/aot-compiler.md
index 2e7c335167..f349c0f93c 100644
--- a/aio/content/cookbook/aot-compiler.md
+++ b/aio/content/guide/aot-compiler.md
@@ -2,7 +2,7 @@
Ahead-of-Time Compilation
@intro
-Learn how to use Ahead-of-time compilation
+Learn how to use Ahead-of-time compilation.
@description
This cookbook describes how to radically improve performance by compiling _Ahead of Time_ (AOT)
diff --git a/aio/content/guide/architecture.md b/aio/content/guide/architecture.md
index bf8972b46c..380757a6b6 100644
--- a/aio/content/guide/architecture.md
+++ b/aio/content/guide/architecture.md
@@ -2,7 +2,7 @@
Architecture Overview
@intro
-The basic building blocks of Angular applications
+The basic building blocks of Angular applications.
@description
You write Angular applications by composing HTML *templates* with Angularized markup,
diff --git a/aio/content/guide/attribute-directives.md b/aio/content/guide/attribute-directives.md
index b8a8df72d0..edf0f1624a 100644
--- a/aio/content/guide/attribute-directives.md
+++ b/aio/content/guide/attribute-directives.md
@@ -9,7 +9,6 @@ An **Attribute** directive changes the appearance or behavior of a DOM element.
# Contents
-
* [Directives overview](#directive-overview)
* [Build a simple attribute directive](#write-directive)
* [Apply the attribute directive to an element in a template](#apply-directive)
@@ -19,9 +18,6 @@ An **Attribute** directive changes the appearance or behavior of a DOM element.
Try the
- After the @Directive
metadata comes the directive's controller class, called HighlightDirective
, which contains the logic for the directive.
-
`) element. In Angular terms, the `
` element is the attribute **host**. -
- Put the template in its own
file that looks like this:
-
` element into the directive's constructor which sets the `
` element's background style to yellow. - - -{@a respond-to-user} ## Respond to user-initiated events Currently, `myHighlight` simply sets an element color. @@ -152,14 +155,10 @@ and respond by setting or clearing the highlight color. Begin by adding `HostListener` to the list of imported symbols; add the `Input` symbol as well because you'll need it soon. - -{@example 'attribute-directives/ts/src/app/highlight.directive.ts' region='imports'} - -Then add two eventhandlers that respond when the mouse enters or leaves, each adorned by the `HostListener` !{_decorator}. - -{@example 'attribute-directives/ts/src/app/highlight.directive.2.ts' region='mouse-methods'} - -The `@HostListener` !{_decorator} lets you subscribe to events of the DOM element that hosts an attribute directive, the `
` in this case. +Then add two eventhandlers that respond when the mouse enters or leaves, +each adorned by the `HostListener` !{_decorator}. +The `@HostListener` !{_decorator} lets you subscribe to events of the DOM +element that hosts an attribute directive, the `
` in this case.
Of course you could reach into the DOM with standard JavaScript and and attach event listeners manually.
There are at least three problems with _that_ approach:
@@ -169,24 +168,19 @@ There are at least three problems with _that_ approach:
1. Talking to DOM API directly isn't a best practice.
The handlers delegate to a helper method that sets the color on the DOM element, `#{_priv}el`,
which you declare and initialize in the constructor.
-
-
-{@example 'attribute-directives/ts/src/app/highlight.directive.2.ts' region='ctor'}
-
Here's the updated directive in full:
+
{@example 'attribute-directives/ts/src/app/highlight.directive.2.ts'}
-Run the app and confirm that the background color appears when the mouse hovers over the `p` and
-disappears as it moves out.
+Run the app and confirm that the background color appears when
+the mouse hovers over the `p` and disappears as it moves out.
+
` element
and sets the directive's highlight color with a property binding.
You're re-using the directive's attribute selector (`[myHighlight]`) to do both jobs.
That's a crisp, compact syntax.
You'll have to rename the directive's `highlightColor` property to `myHighlight` because that's now the color property binding name.
-
-{@example 'attribute-directives/ts/src/app/highlight.directive.2.ts' region='color-2'}
-
This is disagreeable. The word, `myHighlight`, is a terrible property name and it doesn't convey the property's intent.
@@ -244,60 +220,54 @@ _Inside_ the directive the property is known as `highlightColor`.
_Outside_ the directive, where you bind to it, it's known as `myHighlight`.
You get the best of both worlds: the property name you want and the binding syntax you want:
-
-{@example 'attribute-directives/ts/src/app/app.component.html' region='color'}
-
Now that you're binding to `highlightColor`, modify the `onMouseEnter()` method to use it.
-If someone neglects to bind to `highlightColor`, highlight in "red" by default.
+If someone neglects to bind to `highlightColor`, highlight in red:
+Here's the latest version of the directive class.
+## Write a harness to try it
-
-{@example 'attribute-directives/ts/src/app/highlight.directive.3.ts' region='mouse-enter'}
-
-Here's the latest version of the directive class.## Write a harness to try itIt may be difficult to imagine how this directive actually works.
+It may be difficult to imagine how this directive actually works.
In this section, you'll turn `AppComponent` into a harness that
lets you pick the highlight color with a radio button and bind your color choice to the directive.
-Update `app.component.html` as follows:
-Revise the `AppComponent.color` so that it has no initial value.Here is the harness and directive in action.
+Update app.component.html as follows:
+Revise the `AppComponent.color` so that it has no initial value.
+Here are the harness and directive in action.
+
NgModule
injector that you configured with the `!{_bootstrapModule}` method.
## Component injectors
The ability to configure one or more providers at different levels opens up interesting and useful possibilities.
+
### Scenario: service isolation
Architectural reasons may lead you to restrict access to a service to the application domain where it belongs.
@@ -74,57 +76,55 @@ Architectural reasons may lead you to restrict access to a service to the applic
The guide sample includes a `VillainsListComponent` that displays a list of villains.
It gets those villains from a `VillainsService`.
-While you could provide `VillainsService` in the root `AppModule` (that's where you'll find the `HeroesService`),
+While you _could_ provide `VillainsService` in the root `AppModule` (that's where you'll find the `HeroesService`),
that would make the `VillainsService` available everywhere in the application, including the _Hero_ workflows.
-If you later modify the `VillainsService`, you could break something in a hero component somewhere.
-That's not supposed to happen but the way you've provided the service creates that risk.
+If you later modified the `VillainsService`, you could break something in a hero component somewhere.
+That's not supposed to happen but providing the service in the root `AppModule` creates that risk.
Instead, provide the `VillainsService` in the `providers` metadata of the `VillainsListComponent` like this:
-
-
-{@example 'hierarchical-dependency-injection/ts/src/app/villains-list.component.ts' region='metadata'}
-
-By providing `VillainsService` in the `VillainsListComponent` metadata — and nowhere else —,
+By providing `VillainsService` in the `VillainsListComponent` metadata and nowhere else,
the service becomes available only in the `VillainsListComponent` and its sub-component tree.
It's still a singleton, but it's a singleton that exist solely in the _villain_ domain.
-You are confident that a hero component can't access it. You've reduced your exposure to error.
+Now you know that a hero component can't access it. You've reduced your exposure to error.
### Scenario: multiple edit sessions
Many applications allow users to work on several open tasks at the same time.
-For example, in a tax preparation application, the preparer could be working several tax returns,
+For example, in a tax preparation application, the preparer could be working on several tax returns,
switching from one to the other throughout the day.
This guide demonstrates that scenario with an example in the Tour of Heroes theme.
Imagine an outer `HeroListComponent` that displays a list of super heroes.
-To open a hero's tax return, the preparer clicks on a hero name, which opens a component for editing that return.
+To open a hero's tax return, the preparer clicks on a hero name, which opens a component for editing that return.
Each selected hero tax return opens in its own component and multiple returns can be open at the same time.
-Each tax return component
-* is its own tax return editing session.
-* can change a tax return without affecting a return in another component.
-* has the ability to save the changes to its tax return or cancel them.
+Each tax return component has the following characteristics:
+* Is its own tax return editing session.
+* Can change a tax return without affecting a return in another component.
+* Has the ability to save the changes to its tax return or cancel them.
<router-outlet>
) that marks where the router should display a view.
+ The directive (<router-outlet>
) that marks where the router displays a view.
routerLink
contained on or inside the element becomes active/inactive.
`aragraph.
-
-{@example 'structural-directives/ts/src/app/app.component.css' region='p-span'}
-
-The constructed paragraph renders strangely.
-
-