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

Commit ea94e63

Browse files
maipcaitp
authored andcommitted
docs(ngShowHide): use backticks to denote CSS classes and directive names
add backticks around directive names to improve documentation consistency, as it's used in some parts of the docs already. Closes #9081
1 parent e7ac08a commit ea94e63

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/ng/directive/ngShowHide.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*
77
* @description
88
* The `ngShow` directive shows or hides the given HTML element based on the expression
9-
* provided to the ngShow attribute. The element is shown or hidden by removing or adding
10-
* the `ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined
9+
* provided to the `ngShow` attribute. The element is shown or hidden by removing or adding
10+
* the `.ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined
1111
* in AngularJS and sets the display style to none (using an !important flag).
1212
* For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).
1313
*
@@ -19,13 +19,13 @@
1919
* <div ng-show="myValue" class="ng-hide"></div>
2020
* ```
2121
*
22-
* When the ngShow expression evaluates to a falsy value then the ng-hide CSS class is added to the class
23-
* attribute on the element causing it to become hidden. When truthy, the ng-hide CSS class is removed
22+
* When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added to the class
23+
* attribute on the element causing it to become hidden. When truthy, the `.ng-hide` CSS class is removed
2424
* from the element causing the element not to appear hidden.
2525
*
2626
* ## Why is !important used?
2727
*
28-
* You may be wondering why !important is used for the .ng-hide CSS class. This is because the `.ng-hide` selector
28+
* You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector
2929
* can be easily overridden by heavier selectors. For example, something as simple
3030
* as changing the display style on a HTML list item would make hidden elements appear visible.
3131
* This also becomes a bigger issue when dealing with CSS frameworks.
@@ -34,7 +34,7 @@
3434
* specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the
3535
* styling to change how to hide an element then it is just a matter of using !important in their own CSS code.
3636
*
37-
* ### Overriding .ng-hide
37+
* ### Overriding `.ng-hide`
3838
*
3939
* By default, the `.ng-hide` class will style the element with `display:none!important`. If you wish to change
4040
* the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`
@@ -52,7 +52,7 @@
5252
*
5353
* By default you don't need to override in CSS anything and the animations will work around the display style.
5454
*
55-
* ## A note about animations with ngShow
55+
* ## A note about animations with `ngShow`
5656
*
5757
* Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression
5858
* is true and false. This system works like the animation system present with ngClass except that
@@ -85,8 +85,8 @@
8585
* property to block during animation states--ngAnimate will handle the style toggling automatically for you.
8686
*
8787
* @animations
88-
* addClass: .ng-hide - happens after the ngShow expression evaluates to a truthy value and the just before contents are set to visible
89-
* removeClass: .ng-hide - happens after the ngShow expression evaluates to a non truthy value and just before the contents are set to hidden
88+
* addClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a truthy value and the just before contents are set to visible
89+
* removeClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden
9090
*
9191
* @element ANY
9292
* @param {expression} ngShow If the {@link guide/expression expression} is truthy
@@ -174,7 +174,7 @@ var ngShowDirective = ['$animate', function($animate) {
174174
*
175175
* @description
176176
* The `ngHide` directive shows or hides the given HTML element based on the expression
177-
* provided to the ngHide attribute. The element is shown or hidden by removing or adding
177+
* provided to the `ngHide` attribute. The element is shown or hidden by removing or adding
178178
* the `ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined
179179
* in AngularJS and sets the display style to none (using an !important flag).
180180
* For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).
@@ -187,13 +187,13 @@ var ngShowDirective = ['$animate', function($animate) {
187187
* <div ng-hide="myValue"></div>
188188
* ```
189189
*
190-
* When the ngHide expression evaluates to a truthy value then the .ng-hide CSS class is added to the class
191-
* attribute on the element causing it to become hidden. When falsy, the ng-hide CSS class is removed
190+
* When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added to the class
191+
* attribute on the element causing it to become hidden. When falsy, the `.ng-hide` CSS class is removed
192192
* from the element causing the element not to appear hidden.
193193
*
194194
* ## Why is !important used?
195195
*
196-
* You may be wondering why !important is used for the .ng-hide CSS class. This is because the `.ng-hide` selector
196+
* You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector
197197
* can be easily overridden by heavier selectors. For example, something as simple
198198
* as changing the display style on a HTML list item would make hidden elements appear visible.
199199
* This also becomes a bigger issue when dealing with CSS frameworks.
@@ -202,7 +202,7 @@ var ngShowDirective = ['$animate', function($animate) {
202202
* specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the
203203
* styling to change how to hide an element then it is just a matter of using !important in their own CSS code.
204204
*
205-
* ### Overriding .ng-hide
205+
* ### Overriding `.ng-hide`
206206
*
207207
* By default, the `.ng-hide` class will style the element with `display:none!important`. If you wish to change
208208
* the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`
@@ -220,7 +220,7 @@ var ngShowDirective = ['$animate', function($animate) {
220220
*
221221
* By default you don't need to override in CSS anything and the animations will work around the display style.
222222
*
223-
* ## A note about animations with ngHide
223+
* ## A note about animations with `ngHide`
224224
*
225225
* Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression
226226
* is true and false. This system works like the animation system present with ngClass, except that the `.ng-hide`
@@ -244,8 +244,8 @@ var ngShowDirective = ['$animate', function($animate) {
244244
* property to block during animation states--ngAnimate will handle the style toggling automatically for you.
245245
*
246246
* @animations
247-
* removeClass: .ng-hide - happens after the ngHide expression evaluates to a truthy value and just before the contents are set to hidden
248-
* addClass: .ng-hide - happens after the ngHide expression evaluates to a non truthy value and just before the contents are set to visible
247+
* removeClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden
248+
* addClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a non truthy value and just before the contents are set to visible
249249
*
250250
* @element ANY
251251
* @param {expression} ngHide If the {@link guide/expression expression} is truthy then

0 commit comments

Comments
 (0)