Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit ef8a1d1

Browse files
naomiblackchirayuk
authored andcommitted
docs(directives): Add selector notation and some edits for clarity.
1 parent cf0e742 commit ef8a1d1

File tree

3 files changed

+38
-36
lines changed

3 files changed

+38
-36
lines changed

lib/directive/ng_class.dart

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -82,32 +82,32 @@ class NgClass extends _NgClassBase {
8282
}
8383

8484
/**
85-
* Dynamically style only odd rows in a list via data.
85+
* Dynamically style only odd rows in an `ng-repeat` list. `Selector: [ng-class-odd]`
8686
*
87-
* The `ngClassOdd` and `ngClassEven` directives work exactly as
88-
* {@link ng.directive:ngClass ngClass}, except it works in
89-
* conjunction with `ngRepeat` and takes affect only on odd (even) rows.
87+
* This directive works exactly as [ngClass] with regard to String, Array,
88+
* and Map syntax for associating CSS classes with an element, but only affects odd rows in a
89+
* list.
9090
*
91-
* This directive can be applied only within a scope of an `ngRepeat`.
91+
* Also see [ngClassEven], which applies CSS classes to even rows.
9292
*
93-
* ##Examples
94-
*
95-
* index.html:
96-
*
97-
* <li ng-repeat="name in ['John', 'Mary', 'Cate', 'Suz']">
98-
* <span ng-class-odd="'odd'" ng-class-even="'even'">
99-
* {{name}}
100-
* </span>
101-
* </li>
102-
*
103-
* style.css:
93+
* ##Example
94+
* Let's assume that we have a simple stylesheet that defines two CSS classes for the following
95+
* example.
10496
*
10597
* .odd {
10698
* color: red;
10799
* }
108100
* .even {
109101
* color: blue;
110102
* }
103+
*
104+
* The following template applies these classes to the odd and even rows respectively:
105+
*
106+
* <li ng-repeat="name in ['John', 'Mary', 'Cate', 'Suz']">
107+
* <span ng-class-odd="'odd'" ng-class-even="'even'">
108+
* {{name}}
109+
* </span>
110+
* </li>
111111
*/
112112
@Decorator(
113113
selector: '[ng-class-odd]',
@@ -119,30 +119,32 @@ class NgClassOdd extends _NgClassBase {
119119
}
120120

121121
/**
122-
* The `ngClassOdd` and `ngClassEven` directives work exactly as
123-
* {@link ng.directive:ngClass ngClass}, except it works in
124-
* conjunction with `ngRepeat` and takes affect only on odd (even) rows.
122+
* Dynamically style only even rows in an `ng-repeat` list. `Selector: [ng-class-even]`
125123
*
126-
* This directive can be applied only within a scope of an `ngRepeat`.
124+
* This directive works exactly as [ngClass] with regard to String, Array,
125+
* and Map syntax for associating CSS classes with an element, but only affects even rows in a
126+
* list.
127127
*
128-
* ##Examples
128+
* Also see [ngClassEven], which applies CSS classes to even rows.
129129
*
130-
* index.html:
131-
*
132-
* <li ng-repeat="name in ['John', 'Mary', 'Cate', 'Suz']">
133-
* <span ng-class-odd="'odd'" ng-class-even="'even'">
134-
* {{name}}
135-
* </span>
136-
* </li>
137-
*
138-
* style.css:
130+
* ##Example
131+
* Let's assume that we have a simple stylesheet that defines two CSS classes for the following
132+
* example.
139133
*
140134
* .odd {
141135
* color: red;
142136
* }
143137
* .even {
144138
* color: blue;
145139
* }
140+
*
141+
* The following template applies these classes to the odd and even rows respectively:
142+
*
143+
* <li ng-repeat="name in ['John', 'Mary', 'Cate', 'Suz']">
144+
* <span ng-class-odd="'odd'" ng-class-even="'even'">
145+
* {{name}}
146+
* </span>
147+
* </li>
146148
*/
147149
@Decorator(
148150
selector: '[ng-class-even]',

lib/directive/ng_form.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
part of angular.directive;
22

33
/**
4-
* The form directive listens on submission requests and, depending,
5-
* on if an action is set, the form will automatically either allow
6-
* or prevent the default browser submission from occurring.
4+
* Listens on form submission requests and if an action is set, either allows or
5+
* prevents the default browser form submission action from occurring. `Selector: [ng-form]` or
6+
* `.ng-form` or `form` or `fieldset`
77
*/
88
@Decorator(
99
selector: 'form',

lib/directive/ng_model.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ class NgValue {
720720

721721
/**
722722
* Assigns the value of a bound expression to the model when an input checkbox is
723-
* checked.
723+
* checked. `Selector: input[type=checkbox][ng-model][ng-true-value]`
724724
*
725725
* **Usage**
726726
*
@@ -744,9 +744,9 @@ class NgTrueValue {
744744

745745
/**
746746
* Assigns the value of a bound expression to the model when an input checkbox is
747-
* unchecked.
747+
* unchecked. `Selector: input[type=checkbox][ng-model][ng-false-value]`
748748
*
749-
* **Usage**
749+
* **Usage**
750750
*
751751
* <input type=checkbox
752752
* ng-model=model

0 commit comments

Comments
 (0)