Skip to content

Commit 7e82033

Browse files
committed
Translate Directives
1 parent 9b20d20 commit 7e82033

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README-ja-jp.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ _このドキュメントは[AngularJS in Patterns](https://github.com/mgechev/a
1212
* [パーシャル](#パーシャル)
1313
* [コントローラ](#コントローラ)
1414
* [スコープ](#スコープ)
15-
* [Directives](#directives)
15+
* [ディレクティブ](#ディレクティブ)
1616
* [Filters](#filters)
1717
* [Services](#services)
1818
* [AngularJS Patterns](#angularjs-patterns)
@@ -155,19 +155,19 @@ function ChildCtrl($scope) {
155155

156156
`div#child``ChildCtrl` と結びついていますが、 `ChildCtrl` に注入されたスコープは親のスコープ( `BaseCtrl` に注入されたスコープ )からプロトタイプ継承をしているので、 `foo` メソッドは `button#parent-method` でアクセス可能になっています。
157157

158-
### Directives
158+
### ディレクティブ
159159

160-
In AngularJS the directives are the place where all DOM manipulations should be placed. As a rule of thumb, when you have DOM manipulations in your controller you should create a new direcrive or consider refactoring of already existing one, which could handle the required DOM manipulations.
161-
Each directive has a name and logic associated with it. In the simplest case the directive contains only name and definition of *postLink* function, which encapsulates all the logic required for the directive. In more complex cases the directive could contain a lot of properties such as:
160+
AngularJSでは全てのDOM操作がなされるべき場所です。目安としては、コントローラがDOM操作を含む場合、新しいディレクティブを作るか、すでにあるディレクティブが必要なDOM操作ができるようにするためのリファクタリングをするべきでしょう。
161+
全てのディレクティブは名前と関連するロジックを持っています。最もシンプルなケースとしては、ティレクティブは名前と必要なすべてのロジックをカプセル化するための *postLink* 関数を持ちます。少し複雑なケースでは、下記のようなたくさんのプロパティを持ちます:
162162

163-
- template
164-
- compile function
165-
- link function
166-
- etc...
163+
- テンプレート
164+
- コンパイル関数
165+
- リンク関数
166+
- などなど...
167167

168-
By citing the name of the directives they can be used inside the declarative partials.
168+
ディレクティブの名前を利用することで、パーシャルの中で利用することができます。
169169

170-
Example:
170+
:
171171

172172
```JavaScript
173173
myModule.directive('alertButton', function () {
@@ -192,9 +192,9 @@ myModule.directive('alertButton', function () {
192192
<alert-button content="42">Click me</alert-button>
193193
```
194194

195-
In the example above the tag `<alert-button></alert-button>` will be replaced button element. When the user clicks on the button the string `42` will be alerted.
195+
上記の例では、 `<alert-button></alert-button>` タグはボタンエレメントに置換えられます。ユーザがボタンをクリックした時に、文字列の `42` がアラートとして表示されます。
196196

197-
Since the intent of this paper is not to explain the complete API of AngularJS, we will stop with the directives here.
197+
このドキュメントの意図はAngularJSの完全なAPIの解説をすることを意図しているわけではないので、ディレクティブの説明はこの辺りでやめておきます。
198198

199199
### Filters
200200

0 commit comments

Comments
 (0)