Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 470eb37

Browse files
Izhakipetebacondarwin
authored andcommitted
docs(guide/directive): clarification on the 'matches' terminology
Closes #8120
1 parent 4baf25b commit 470eb37

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/content/guide/directive.ngdoc

+12-2
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,28 @@ mirrors the process of compiling source code in
4343
Before we can write a directive, we need to know how Angular's {@link guide/compiler HTML compiler}
4444
determines when to use a given directive.
4545

46-
In the following example, we say that the `<input>` element **matches** the `ngModel` directive.
46+
Similar to the terminology used when an [element **matches** a selector]
47+
(https://developer.mozilla.org/en-US/docs/Web/API/Element.matches), we say an element **matches** a
48+
directive when the directive is part of its declaration.
49+
50+
In the following example, we say that the `<input>` element **matches** the `ngModel` directive
4751

4852
```html
4953
<input ng-model="foo">
5054
```
5155

52-
The following also **matches** `ngModel`:
56+
The following `<input>` element also **matches** `ngModel`:
5357

5458
```html
5559
<input data-ng-model="foo">
5660
```
5761

62+
And the following <person> element **matches** the `person` directive:
63+
64+
```html
65+
<person>{{name}}</person>
66+
```
67+
5868
### Normalization
5969

6070
Angular **normalizes** an element's tag and attribute name to determine which elements match which

0 commit comments

Comments
 (0)