diff --git a/aio-ja/content/examples/toh-pt6/src/app/hero.service.en.ts b/aio-ja/content/examples/toh-pt6/src/app/hero.service.en.ts
index 80d511c776..c1e0b4d094 100644
--- a/aio-ja/content/examples/toh-pt6/src/app/hero.service.en.ts
+++ b/aio-ja/content/examples/toh-pt6/src/app/hero.service.en.ts
@@ -40,7 +40,7 @@ export class HeroService {
// #enddocregion getHeroes-1
.pipe(
// #enddocregion getHeroes-2
- tap(heroes => this.log('fetched heroes')),
+ tap(_ => this.log('fetched heroes')),
// #docregion getHeroes-2
catchError(this.handleError('getHeroes', []))
);
diff --git a/aio-ja/content/guide/ajs-quick-reference.md b/aio-ja/content/guide/ajs-quick-reference.md
index b900fd0a78..2bc8f4531b 100644
--- a/aio-ja/content/guide/ajs-quick-reference.md
+++ b/aio-ja/content/guide/ajs-quick-reference.md
@@ -202,10 +202,10 @@ The following are some of the key AngularJS built-in directives and their equiva
### Bootstrapping
-
+
-
+
Angular doesn't have a bootstrap directive.
diff --git a/aio-ja/content/guide/animations.en.md b/aio-ja/content/guide/animations.en.md
index b92e922066..e266c72f9f 100644
--- a/aio-ja/content/guide/animations.en.md
+++ b/aio-ja/content/guide/animations.en.md
@@ -37,7 +37,7 @@ To get started with adding Angular animations to your project, import the animat
Import `BrowserAnimationsModule`, which introduces the animation capabilities into your Angular root application module.
-
+
@@ -49,7 +49,7 @@ Import `BrowserAnimationsModule`, which introduces the animation capabilities in
If you plan to use specific animation functions in component files, import those functions from `@angular/animations`.
-
+
@@ -61,7 +61,7 @@ If you plan to use specific animation functions in component files, import those
In the component file, add a metadata property called `animations:` within the `@Component()` decorator. You put the trigger that defines an animation within the `animations` metadata property.
-
+
## Animating a simple transition
@@ -82,12 +82,12 @@ Use the `style()` function to define a set of styles to associate with a given s
Let's see how Angular's `state()` function works with the `style()` function to set CSS style attributes. In this code snippet, multiple style attributes are set at the same time for the state. In the `open` state, the button has a height of 200 pixels, an opacity of 1, and a background color of yellow.
-
+
In the `closed` state, shown below, the button has a height of 100 pixels, an opacity of 0.5, and a background color of green.
-
+
### Transitions and timing
@@ -134,7 +134,7 @@ The third argument, `easing`, controls how the animation [accelerates and decele
This example provides a state transition from `open` to `closed` with a one second transition between states.
-
@@ -142,7 +142,7 @@ In the code snippet above, the `=>` operator indicates unidirectional transition
This example adds a state transition from the `closed` state to the `open` state with a 0.5 second transition animation arc.
-
@@ -180,7 +180,7 @@ In this example, we'll name the trigger `openClose`, and attach it to the `butto
Animations are defined in the metadata of the component that controls the HTML element to be animated. Put the code that defines your animations under the `animations:` property within the `@Component()` decorator.
-
@@ -194,7 +194,7 @@ The animation is executed or triggered when the expression value changes to a ne
The following code snippet binds the trigger to the value of the `isOpen` property.
-
@@ -216,15 +216,15 @@ Here are the code files discussed in the transition example.
-
-
-
+
diff --git a/aio-ja/content/guide/animations.md b/aio-ja/content/guide/animations.md
index b5c1bf0816..05e4d7bc48 100644
--- a/aio-ja/content/guide/animations.md
+++ b/aio-ja/content/guide/animations.md
@@ -37,7 +37,7 @@ Angularアニメーションをプロジェクトに追加するには、標準
`BrowserAnimationsModule`をインポートしてください。これによってアニメーション機能をAngularのルートアプリケーションモジュールに取り込みます。
-
+
@@ -21,7 +21,7 @@ Angular offers two ways to compile your application:
1. **_Just-in-Time_ (JIT)**, which compiles your app in the browser at runtime.
1. **_Ahead-of-Time_ (AOT)**, which compiles your app at build time.
-JIT compilation is the default when you run the _build-only_ or the _build-and-serve-locally_ CLI commands:
+JIT compilation is the default when you run the [`ng build`](cli/build) (build only) or [`ng serve`](cli/serve) (build and serve locally) CLI commands:
ng build
@@ -30,7 +30,7 @@ JIT compilation is the default when you run the _build-only_ or the _build-and-s
{@a compile}
-For AOT compilation, append the `--aot` flags to the _build-only_ or the _build-and-serve-locally_ CLI commands:
+For AOT compilation, include the `--aot` option with the `ng build` or `ng serve` command:
ng build --aot
@@ -41,7 +41,7 @@ For AOT compilation, append the `--aot` flags to the _build-only_ or the _build-
The `ng build` command with the `--prod` meta-flag (`ng build --prod`) compiles with AOT by default.
-See the [CLI documentation](https://github.com/angular/angular-cli/wiki) for details, especially the [`build` topic](https://github.com/angular/angular-cli/wiki/build).
+See the [CLI command reference](cli) and [Building and serving Angular apps](guide/build) for more information.
@@ -1308,6 +1308,28 @@ Chuck: After reviewing your PR comment I'm still at a loss. See [comment there](
}
```
+{@a tsconfig-extends}
+## Configuration inheritance with extends
+Similar to TypeScript Compiler, Angular Compiler also supports `extends` in the `tsconfig.json` on `angularCompilerOptions`. A tsconfig file can inherit configurations from another file using the `extends` property.
+ The `extends` is a top level property parallel to `compilerOptions` and `angularCompilerOptions`.
+ The configuration from the base file are loaded first, then overridden by those in the inheriting config file.
+ Example:
+```json
+{
+ "extends": "../tsconfig.base.json",
+ "compilerOptions": {
+ "experimentalDecorators": true,
+ ...
+ },
+ "angularCompilerOptions": {
+ "fullTemplateTypeCheck": true,
+ "preserveWhitespaces": true,
+ ...
+ }
+}
+```
+ More information about tsconfig extends can be found in the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
+
{@a compiler-options}
## Angular template compiler options
diff --git a/aio-ja/content/guide/architecture-components.en.md b/aio-ja/content/guide/architecture-components.en.md
index e361c62cd6..75b1029fbd 100644
--- a/aio-ja/content/guide/architecture-components.en.md
+++ b/aio-ja/content/guide/architecture-components.en.md
@@ -15,7 +15,7 @@ Its `selectHero()` method sets a `selectedHero` property when the user clicks to
The component acquires the heroes from a service, which is a TypeScript [parameter property](http://www.typescriptlang.org/docs/handbook/classes.html#parameter-properties) on the constructor.
The service is provided to the component through the dependency injection system.
-
+
Angular creates, updates, and destroys components as the user moves through the application. Your app can take action at each moment in this lifecycle through optional [lifecycle hooks](guide/lifecycle-hooks), like `ngOnInit()`.
@@ -31,7 +31,7 @@ In addition to containing or pointing to the template, the `@Component` metadata
Here's an example of basic metadata for `HeroListComponent`.
-
+
This example shows some of the most useful `@Component` configuration options:
@@ -63,7 +63,7 @@ A template looks like regular HTML, except that it also contains Angular [templa
For example, here is a template for the Tutorial's `HeroListComponent`.
-
+
This template uses typical HTML elements like `
` and `
`, and also includes Angular template-syntax elements, `*ngFor`, `{{hero.name}}`, `(click)`, `[hero]`, and ``. The template-syntax elements tell Angular how to render the HTML to the screen, using program logic and data.
@@ -87,7 +87,7 @@ The following diagram shows the four forms of data binding markup. Each form has
This example from the `HeroListComponent` template uses three of these forms.
-
+
* The `{{hero.name}}` [*interpolation*](guide/displaying-data#interpolation)
displays the component's `hero.name` property value within the `
` element.
@@ -101,7 +101,7 @@ Two-way data binding (used mainly in [template-driven forms](guide/forms))
combines property and event binding in a single notation.
Here's an example from the `HeroDetailComponent` template that uses two-way data binding with the `ngModel` directive.
-
+
In two-way binding, a data property value flows to the input box from the component as with property binding.
The user's changes also flow back to the component, resetting the property to the latest value,
@@ -164,7 +164,7 @@ Just as for components, the metadata for a directive associates the decorated cl
*Structural directives* alter layout by adding, removing, and replacing elements in the DOM.
The example template uses two built-in structural directives to add application logic to how the view is rendered.
-
+
* [`*ngFor`](guide/displaying-data#ngFor) is an iterative; it tells Angular to stamp out one `
` per hero in the `heroes` list.
* [`*ngIf`](guide/displaying-data#ngIf) is a conditional; it includes the `HeroDetail` component only if a selected hero exists.
@@ -176,7 +176,7 @@ In templates they look like regular HTML attributes, hence the name.
The `ngModel` directive, which implements two-way data binding, is an example of an attribute directive. `ngModel` modifies the behavior of an existing element (typically ``) by setting its display value property and responding to change events.
-
+
Angular has more pre-defined directives that either alter the layout structure
(for example, [ngSwitch](guide/template-syntax#ngSwitch))
diff --git a/aio-ja/content/guide/architecture-components.md b/aio-ja/content/guide/architecture-components.md
index 7241a762b6..c7529c9598 100644
--- a/aio-ja/content/guide/architecture-components.md
+++ b/aio-ja/content/guide/architecture-components.md
@@ -14,7 +14,7 @@
コンポーネントはサービスからヒーローを取得します。これはコンストラクターのTypeScript[パラメータプロパティ](http://www.typescriptlang.org/docs/handbook/classes.html#parameter-properties)です。
サービスは、依存性の注入システムを介してコンポーネントに提供されます。
-
+
Angularは、ユーザーがアプリケーションを移動するときにコンポーネントを作成、更新、および破棄します。アプリは、ライフサイクルの各段階で、`ngOnInit()`などの[ライフサイクルフック](guide/lifecycle-hooks)を使用してアクションを実行できます。
@@ -31,7 +31,7 @@ Angularは、ユーザーがアプリケーションを移動するときにコ
`HeroListComponent`の基本メタデータの例を次に示します。
-
+
この例は、もっとも役立つ `@Component` の設定オプションの一部です:
@@ -62,7 +62,7 @@ Angularは、ユーザーがアプリケーションを移動するときにコ
たとえば、チュートリアルの`HeroListComponent`のテンプレートは次のようになります。
-
+
このテンプレートは `
diff --git a/aio-ja/content/guide/architecture-next-steps.en.md b/aio-ja/content/guide/architecture-next-steps.en.md
index 5ee726ae37..53f5ba4c9a 100644
--- a/aio-ja/content/guide/architecture-next-steps.en.md
+++ b/aio-ja/content/guide/architecture-next-steps.en.md
@@ -4,20 +4,20 @@ After you understand the basic Angular building blocks, you can begin to learn m
about the features and tools that are available to help you develop and deliver Angular applications.
Here are some key features.
-## Responsive programming tools
+## Responsive programming
* [Lifecycle hooks](guide/lifecycle-hooks): Tap into key moments in the lifetime of a component, from its creation to its destruction, by implementing the lifecycle hook interfaces.
* [Observables and event processing](guide/observables): How to use observables with components and services to publish and subscribe to messages of any type, such as user-interaction events and asynchronous operation results.
-## Client-server interaction tools
+## Client-server interaction
* [HTTP](guide/http): Communicate with a server to get data, save data, and invoke server-side actions with an HTTP client.
* [Server-side Rendering](guide/universal): Angular Universal generates static application pages on the server through server-side rendering (SSR). This allows you to run your Angular app on the server in order to improve performance and show the first page quickly on mobile and low-powered devices, and also facilitate web crawlers.
* [Service Workers](guide/service-worker-intro): Use a service worker to reduce dependency on the network
-significantly improving the use experience.
+significantly improving the user experience.
## Domain-specific libraries
@@ -28,23 +28,28 @@ without deep knowledge of animation techniques or CSS.
## Support for the development cycle
+* [Compilation](guide/aot-compiler): Angular provides just-in-time (JIT) compilation for the development environment, and ahead-of-time (AOT) compilation for the production environment.
+
* [Testing platform](guide/testing): Run unit tests on your application parts as they interact with the Angular framework.
* [Internationalization](guide/i18n): Make your app available in multiple languages with Angular's internationalization (i18n) tools.
-* [Compilation](guide/aot-compiler): Angular provides just-in-time (JIT) compilation for the development environment, and ahead-of-time (AOT) compilation for the production environment.
-
* [Security guidelines](guide/security): Learn about Angular's built-in protections against common web-app vulnerabilities and attacks such as cross-site scripting attacks.
-## Setup and deployment tools
+## Setup, build, and deployment configuration
-* [Setup for local development](guide/setup): Set up a new project for development with QuickStart.
+* [CLI Command Reference](cli): The Angular CLI is a command-line tool that you use to create projects, generate application and library code, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.
-* [Installation](guide/npm-packages): The [Angular CLI](https://cli.angular.io/), Angular applications, and Angular itself depend on features and functionality provided by libraries that are available as [npm](https://docs.npmjs.com/) packages.
+* [Workspace and File Structure](guide/file-structure): Understand the structure of Angular workspace and project folders.
+
+* [npm Packages](guide/npm-packages): The Angular Framework, Angular CLI, and components used by Angular applications are packaged as [npm](https://docs.npmjs.com/) packages and distributed via the npm registry. The Angular CLI creates a default `package.json` file, which specifies a starter set of packages that work well together and jointly support many common application scenarios.
* [TypeScript configuration](guide/typescript-configuration): TypeScript is the primary language for Angular application development.
* [Browser support](guide/browser-support): Make your apps compatible across a wide range of browsers.
+* [Building and Serving](guide/build): Learn to define different build and proxy server configurations for your project, such as development, staging, and production.
+
* [Deployment](guide/deployment): Learn techniques for deploying your Angular application to a remote server.
+
diff --git a/aio-ja/content/guide/architecture-next-steps.md b/aio-ja/content/guide/architecture-next-steps.md
index 68f40be5a3..4c8495ad70 100644
--- a/aio-ja/content/guide/architecture-next-steps.md
+++ b/aio-ja/content/guide/architecture-next-steps.md
@@ -4,13 +4,13 @@
Angularアプリケーションの開発と提供に役立つ機能とツールの詳細を学ぶことができます。
ここにいくつかの重要な機能があります。
-## レスポンシブプログラミングツール
+## レスポンシブプログラミング
* [ライフサイクル・フック](guide/lifecycle-hooks): ライフサイクル・フックインターフェースを実装することで、コンポーネントの作成から破棄まで、コンポーネントの存続期間中の重要な瞬間に触れることができます。
* [Observable とイベント処理](guide/observables): コンポーネントやサービスで observable を使用して、ユーザーインタラクションイベントや非同期操作結果など、あらゆるタイプのメッセージをパブリッシュして購読する方法です。
-## クライアントとサーバーのインタラクションツール
+## クライアントとサーバーのインタラクション
* [HTTP](guide/http): HTTP クライアントを使用してサーバーと通信してデータを取得、保存し、サーバー側のアクションを呼び出します。
@@ -28,23 +28,27 @@ Angularアプリケーションの開発と提供に役立つ機能とツール
## 開発サイクルのサポート
+* [コンパイル](guide/aot-compiler): Angularは、開発環境用のジャストインタイム(JIT)コンパイルと、本番環境用の事前(AOT)コンパイルを提供します。
+
* [テスティングプラットフォーム](guide/testing): Angular フレームワークとやり取りするアプリケーションの部品において、ユニットテストを実行します。
* [国際化](guide/i18n): Angular の国際化(i18n)ツールを使用して、アプリを複数の言語で利用できるようにします。
-* [コンパイル](guide/aot-compiler): Angular は開発環境用のジャストインタイム(JIT)コンパイルと、本番環境用の事前(AOT)コンパイルを提供します。
-
* [セキュリティガイドライン](guide/security): 一般的な Web アプリケーションの脆弱性やクロスサイトスクリプティングなどの攻撃に対する Angular の組み込みの保護機能について説明します。
-## セットアップとデプロイツール
+## セットアップ、ビルドとデプロイの設定
-* [ローカル環境のセットアップ](guide/setup): クイックスタートで開発用の新しいプロジェクトをセットアップします。
+* [CLIコマンドリファレンス](cli): Angular CLIは、プロジェクトの作成、アプリケーションおよびライブラリコードの生成、およびテスト、バンドル、デプロイなどのさまざまな進行中の開発タスクの実行に使用するコマンドラインツールです。
-* [インストール](guide/npm-packages): [Angular CLI](https://cli.angular.io/)やAngular アプリケーション、そしてAngular自身は npm パッケージとして利用可能なライブラリによって提供される機能に依存します。
+* [ワークスペースとファイル構成](guide/file-structure): Angularワークスペースとプロジェクトフォルダの構造を理解する。
+
+* [npmパッケージ](guide/npm-packages): Angular フレームワーク、Angular CLI、Angularアプリケーションで使用されるコンポーネントは、[npm](https://docs.npmjs.com/)パッケージとしてパッケージ化され、npmレジストリを介して配布されます。 Angular CLIはデフォルトの `package.json`ファイルを作成します。このファイルは、うまく機能し、多くの一般的なアプリケーションシナリオを共同でサポートするパッケージのスターターセットを指定します。
* [TypeScript の設定](guide/typescript-configuration): TypeScript は Angular アプリケーション開発における主要な言語です。
* [ブラウザのサポート](guide/browser-support): アプリを幅広いブラウザに対応させます。
+* [ビルドとサーブ](guide/build): 開発時、ステージング、およびプロダクションなど、プロジェクトのさまざまなビルドおよびプロキシサーバー構成を定義する方法を学びます。
+
* [デプロイメント](guide/deployment): Angular アプリケーションをリモートサーバーにデプロイする方法を学びます。
diff --git a/aio-ja/content/guide/architecture-services.en.md b/aio-ja/content/guide/architecture-services.en.md
index d555f3577c..8559581702 100644
--- a/aio-ja/content/guide/architecture-services.en.md
+++ b/aio-ja/content/guide/architecture-services.en.md
@@ -28,11 +28,11 @@ available to components through *dependency injection*.
Here's an example of a service class that logs to the browser console.
-
+
Services can depend on other services. For example, here's a `HeroService` that depends on the `Logger` service, and also uses `BackendService` to get heroes. That service in turn might depend on the `HttpClient` service to fetch heroes asynchronously from a server.
-
+
## Dependency injection (DI)
@@ -62,7 +62,7 @@ A dependency doesn't have to be a service—it could be a function, for exam
When Angular creates a new instance of a component class, it determines which services or other dependencies that component needs by looking at the constructor parameter types. For example, the constructor of `HeroListComponent` needs `HeroService`.
-
+
When Angular discovers that a component depends on a service, it first checks if the injector has any existing instances of that service. If a requested service instance doesn't yet exist, the injector makes one using the registered provider, and adds it to the injector before returning the service to Angular.
@@ -82,7 +82,7 @@ or you can register providers with specific modules or components.
You register providers in the metadata of the service (in the `@Injectable()` decorator),
or in the `@NgModule()` or `@Component()` metadata
-* By default, the Angular CLI command `ng generate service` registers a provider with the root injector for your service by including provider metadata in the `@Injectable()` decorator. The tutorial uses this method to register the provider of HeroService class definition.
+* By default, the Angular CLI command [`ng generate service`](cli/generate) registers a provider with the root injector for your service by including provider metadata in the `@Injectable()` decorator. The tutorial uses this method to register the provider of HeroService class definition.
```
@Injectable({
@@ -111,6 +111,6 @@ or in the `@NgModule()` or `@Component()` metadata
service with each new instance of that component.
At the component level, register a service provider in the `providers` property of the `@Component()` metadata.
-
+
For more detailed information, see the [Dependency Injection](guide/dependency-injection) section.
diff --git a/aio-ja/content/guide/architecture-services.md b/aio-ja/content/guide/architecture-services.md
index a769c2c578..d81dc911c7 100644
--- a/aio-ja/content/guide/architecture-services.md
+++ b/aio-ja/content/guide/architecture-services.md
@@ -28,11 +28,11 @@ Angularはこれらの原則を*強制*しません。Angularはアプリケー
次に、ブラウザコンソールにログを記録するサービスクラスの例を示します。
-
+
サービスは他のサービスに依存することがあります。たとえば、`HeroService` は `Logger` サービスに依存し、`BackendService` を使ってヒーローを取得します。そのサービスは、サーバーからヒーローを非同期的に取り出すための `HttpClient` サービスに依存するかもしれません。
-
+
## 依存性の注入 (DI)
@@ -62,7 +62,7 @@ DI は Angular フレームワークとつながり、必要なサービスや
Angular は、コンポーネントクラスの新しいインスタンスを作成すると、コンストラクターのパラメータタイプを調べることによってコンポーネントが必要とするサービスやその他の依存関係を判断します。たとえば、`HeroListComponent` のコンストラクターには `HeroService` が必要です。
-
+
Angular はコンポーネントがサービスに依存していることを検出すると、インジェクターにそのサービスの既存のインスタンスがあるかどうかをまずチェックします。要求されたサービスインスタンスがまだ存在しない場合、インジェクターは登録されたプロバイダーを使用してインジェクターを作成し、サービスを Angular に返す前にインジェクターに追加します。
@@ -82,7 +82,7 @@ Angular はコンポーネントがサービスに依存していることを検
プロバイダーはサービスのメタデータ(`@Injectable()` デコレーター内) または
`@NgModule()` や `@Component()` メタデータにプロバイダーを登録します
-* デフォルトでは Angular CLI コマンド `ng generate service` はプロバイダーのメタデータを `@Injectable()` デコレーターに含めることによってプロバイダーをルートインジェクターに登録します。このチュートリアルでは、このメソッドを使用して HeroService クラス定義のプロバイダーを登録します。
+* デフォルトでは Angular CLI コマンド [ng generate service](cli/generate) はプロバイダーのメタデータを `@Injectable()` デコレーターに含めることによってプロバイダーをルートインジェクターに登録します。このチュートリアルでは、このメソッドを使用して HeroService クラス定義のプロバイダーを登録します。
``` js
@Injectable({
@@ -111,6 +111,6 @@ Angular はコンポーネントがサービスに依存していることを検
新しいサービスインスタンスが取得されます。
コンポーネントレベルで `@Component()` メタデータの `providers` プロパティにサービスプロバイダーを登録します。
-
+
詳細は、[依存性の注入](guide/dependency-injection)セクションを参照してください.
diff --git a/aio-ja/content/guide/attribute-directives.en.md b/aio-ja/content/guide/attribute-directives.en.md
index bec3a903ac..270985d5b0 100644
--- a/aio-ja/content/guide/attribute-directives.en.md
+++ b/aio-ja/content/guide/attribute-directives.en.md
@@ -37,13 +37,13 @@ This page demonstrates building a simple _appHighlight_ attribute
directive to set an element's background color
when the user hovers over that element. You can apply it like this:
-
+
{@a write-directive}
### Write the directive code
-Create the directive class file in a terminal window with this CLI command.
+Create the directive class file in a terminal window with the CLI command [`ng generate directive`](cli/generate).
ng generate directive highlight
@@ -59,9 +59,9 @@ _Directives_ must be declared in [Angular Modules](guide/ngmodules) in the same
The generated `src/app/highlight.directive.ts` is as follows:
-
+
-The imported `Directive` symbol provides the Angular the `@Directive` decorator.
+The imported `Directive` symbol provides Angular the `@Directive` decorator.
The `@Directive` decorator's lone configuration property specifies the directive's
[CSS attribute selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors), `[appHighlight]`.
@@ -92,7 +92,7 @@ Exporting `HighlightDirective` makes the directive accessible.
Now edit the generated `src/app/highlight.directive.ts` to look as follows:
-
+
The `import` statement specifies an additional `ElementRef` symbol from the Angular `core` library:
@@ -111,7 +111,7 @@ This first implementation sets the background color of the host element to yello
To use the new `HighlightDirective`, add a paragraph (`
`) element to the template of the root `AppComponent` and apply the directive as an attribute.
-
+
Now run the application to see the `HighlightDirective` in action.
@@ -136,12 +136,12 @@ and respond by setting or clearing the highlight color.
Begin by adding `HostListener` to the list of imported symbols.
-
+
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.
@@ -162,11 +162,11 @@ The handlers delegate to a helper method that sets the color on the host DOM ele
The helper method, `highlight`, was extracted from the constructor.
The revised constructor simply declares the injected `el: ElementRef`.
-
+
Here's the updated directive in full:
-
+
Run the app and confirm that the background color appears when
the mouse hovers over the `p` and disappears as it moves out.
@@ -183,11 +183,11 @@ Currently the highlight color is hard-coded _within_ the directive. That's infle
In this section, you give the developer the power to set the highlight color while applying the directive.
Begin by adding `Input` to the list of symbols imported from `@angular/core`.
-
+
Add a `highlightColor` property to the directive class like this:
-
+
{@a input}
@@ -200,19 +200,19 @@ Without that input metadata, Angular rejects the binding; see [below](guide/attr
Try it by adding the following directive binding variations to the `AppComponent` template:
-
+
Add a `color` property to the `AppComponent`.
-
+
Let it control the highlight color with a property binding.
-
+
That's good, but it would be nice to _simultaneously_ apply the directive and set the color _in the same attribute_ like this.
-
+
The `[appHighlight]` attribute binding both applies the highlighting directive to the `
` element
and sets the directive's highlight color with a property binding.
@@ -221,7 +221,7 @@ That's a crisp, compact syntax.
You'll have to rename the directive's `highlightColor` property to `appHighlight` because that's now the color property binding name.
-
+
This is disagreeable. The word, `appHighlight`, is a terrible property name and it doesn't convey the property's intent.
@@ -233,23 +233,23 @@ Fortunately you can name the directive property whatever you want _and_ **_alias
Restore the original property name and specify the selector as the alias in the argument to `@Input`.
-
+
_Inside_ the directive the property is known as `highlightColor`.
_Outside_ the directive, where you bind to it, it's known as `appHighlight`.
You get the best of both worlds: the property name you want and the binding syntax you want:
-
+
Now that you're binding via the alias to the `highlightColor`, modify the `onMouseEnter()` method to use that property.
If someone neglects to bind to `appHighlightColor`, highlight the host element in red:
-
+
Here's the latest version of the directive class.
-
+
## Write a harness to try it
@@ -259,11 +259,11 @@ lets you pick the highlight color with a radio button and bind your color choice
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.
@@ -283,12 +283,12 @@ Let the template developer set the default color.
Add a second **input** property to `HighlightDirective` called `defaultColor`:
-
+
Revise the directive's `onMouseEnter` so that it first tries to highlight with the `highlightColor`,
then with the `defaultColor`, and falls back to "red" if both properties are undefined.
-
+
How do you bind to a second property when you're already binding to the `appHighlight` attribute name?
@@ -296,7 +296,7 @@ As with components, you can add as many directive property bindings as you need
The developer should be able to write the following template HTML to both bind to the `AppComponent.color`
and fall back to "violet" as the default color.
-
+
Angular knows that the `defaultColor` binding belongs to the `HighlightDirective`
because you made it _public_ with the `@Input` decorator.
@@ -319,12 +319,12 @@ This page covered how to:
The final source code follows:
-
-
-
-
-
-
+
+
+
+
+
+
@@ -338,11 +338,11 @@ You can also experience and download the
+
You've seen it with an alias:
-
+
Either way, the `@Input` decorator tells Angular that this property is
_public_ and available for binding by a parent component.
@@ -374,7 +374,7 @@ You can tell if `@Input` is needed by the position of the property name in a bin
Now apply that reasoning to the following example:
-
+
* The `color` property in the expression on the right belongs to the template's component.
The template and its component trust each other.
diff --git a/aio-ja/content/guide/attribute-directives.md b/aio-ja/content/guide/attribute-directives.md
index 387f166be6..3f48474618 100644
--- a/aio-ja/content/guide/attribute-directives.md
+++ b/aio-ja/content/guide/attribute-directives.md
@@ -2,7 +2,7 @@
**属性**ディレクティブは、DOM要素の見た目や動作を変更します。
-を実行してください。
+を実行してください。
{@a directive-overview}
@@ -28,13 +28,13 @@ Angularには、3つのディレクティブがあります。
このページでは、ユーザーがその要素の上を移動したときに、要素の背景色を設定するシンプルな _appHighlight_ 属性ディレクティブを作成する方法を示します。これは次のように書くことができます。
-
+
{@a write-directive}
### ディレクティブのコードを書く
-次のCLIコマンドをターミナル画面に入力して、ディレクティブクラスを作成します。
+CLIコマンド [`ng generate directive`](cli/generate) をターミナル画面に入力して、ディレクティブクラスを作成します。
ng generate directive highlight
@@ -50,7 +50,7 @@ _ディレクティブ_ は、 _コンポーネント_ と同じ方法で[Angul
生成された`src/app/highlight.directive.ts`は次のとおりです。
-
+
インポートされた`Directive`シンボルは、Angularの`@Directive`デコレーターを提供します。
@@ -74,7 +74,7 @@ _属性セレクタ_ パターンは、この種のディレクティブの名
生成された`src/app/highlight.directive.ts`を次のように編集します。
-
+
`import`ステートメントは、Angularの`core`ライブラリから追加の`ElementRef`シンボルを指定します。
@@ -90,7 +90,7 @@ _属性セレクタ_ パターンは、この種のディレクティブの名
新しい`HighlightDirective`を使用するには、ルートである`AppComponent`のテンプレートへ段落(`
+You can download an example of the app that you created in this Getting Started guide.
- A folder where you can put images and anything else to be copied wholesale
- when you build your application.
-
-
-
-
-
- `environments/*`
-
-
-
-
- This folder contains one file for each of your destination environments,
- each exporting simple configuration variables to use in your application.
- The files are replaced on-the-fly when you build your app.
- You might use a different API endpoint for development than you do for production
- or maybe different analytics tokens.
- You might even use some mock services.
- Either way, the CLI has you covered.
-
-
-
-
-
-
- `browserslist`
-
-
-
-
- A configuration file to share [target browsers](https://github.com/browserslist/browserslist) between different front-end tools.
-
-
-
-
-
-
- `favicon.ico`
-
-
-
-
- Every site wants to look good on the bookmark bar.
- Get started with your very own Angular icon.
-
-
-
-
-
-
- `index.html`
-
-
-
-
- The main HTML page that is served when someone visits your site.
- Most of the time you'll never need to edit it.
- The CLI automatically adds all `js` and `css` files when building your app so you
- never need to add any `