File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,18 @@ function classDirective(name, selector) {
71
71
* The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding
72
72
* an expression that represents all classes to be added.
73
73
*
74
+ * The directive operates in three different ways, depending on which of three types the expression
75
+ * evaluates to:
76
+ *
77
+ * 1. If the expression evaluates to a string, the string should be one or more space-delimited class
78
+ * names.
79
+ *
80
+ * 2. If the expression evaluates to an array, each element of the array should be a string that is
81
+ * one or more space-delimited class names.
82
+ *
83
+ * 3. If the expression evaluates to an object, then for each key-value pair of the
84
+ * object with a truthy value the corresponding key is used as a class name.
85
+ *
74
86
* The directive won't add duplicate classes if a particular class was already set.
75
87
*
76
88
* When the expression changes, the previously added classes are removed and only then the
You can’t perform that action at this time.
0 commit comments