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

Communicating use more clearly. #4914

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ng/directive/ngClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function classDirective(name, selector) {
* @example Example that demonstrates basic bindings via ngClass directive.
<example>
<file name="index.html">
<p ng-class="{strike: strike, bold: bold, red: red}">Map Syntax Example</p>
<p ng-class="{strikeClass: strike, boldClass: bold, redClass: red}">Map Syntax Example</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might make the intent more clear to call the expression variables shouldStrike and shouldBold and shouldRed, too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to do that, but below we allow them to type "bold" and have it bold. I would rather not force them to type shouldBold

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kentcdodds - Actually, the opposite is true. What you type in below is the name of the CSS class, so given you change you would need to type in boldClass to get it to work.

<input type="checkbox" ng-model="bold"> bold
<input type="checkbox" ng-model="strike"> strike
<input type="checkbox" ng-model="red"> red
Expand All @@ -112,13 +112,13 @@ function classDirective(name, selector) {
<input ng-model="style3" placeholder="Type: red"><br>
</file>
<file name="style.css">
.strike {
.strikeClass {
text-decoration: line-through;
}
.bold {
.boldClass {
font-weight: bold;
}
.red {
.redClass {
color: red;
}
</file>
Expand Down