| OLD | NEW |
| 1 part of angular.directive; | 1 part of angular.directive; |
| 2 | 2 |
| 3 /** | 3 /** |
| 4 * The ngHide directive shows or hides the given HTML element based on the | 4 * The ngHide directive shows or hides the given HTML element based on the |
| 5 * expression provided to the ngHide attribute. The element is shown or hidden | 5 * expression provided to the ngHide attribute. The element is shown or hidden |
| 6 * by changing the removing or adding the ng-hide CSS class onto the element. | 6 * by changing the removing or adding the ng-hide CSS class onto the element. |
| 7 */ | 7 */ |
| 8 @Decorator( | 8 @NgDirective( |
| 9 selector: '[ng-hide]', | 9 selector: '[ng-hide]', |
| 10 map: const {'ng-hide': '=>hide'}) | 10 map: const {'ng-hide': '=>hide'}) |
| 11 class NgHide { | 11 class NgHideDirective { |
| 12 static String NG_HIDE_CLASS = 'ng-hide'; | 12 static String NG_HIDE_CLASS = 'ng-hide'; |
| 13 | 13 |
| 14 final dom.Element element; | 14 final dom.Element element; |
| 15 final Animate animate; | |
| 16 | 15 |
| 17 NgHide(this.element, this.animate); | 16 NgHideDirective(this.element); |
| 18 | 17 |
| 19 set hide(value) { | 18 set hide(value) { |
| 20 if (toBool(value)) { | 19 if (toBool(value)) { |
| 21 animate.addClass(element, NG_HIDE_CLASS); | 20 element.classes.add(NG_HIDE_CLASS); |
| 22 } else { | 21 } else { |
| 23 animate.removeClass(element, NG_HIDE_CLASS); | 22 element.classes.remove(NG_HIDE_CLASS); |
| 24 } | 23 } |
| 25 } | 24 } |
| 26 } | 25 } |
| 27 | 26 |
| 28 /** | 27 /** |
| 29 * The ngShow directive shows or hides the given HTML element based on the | 28 * The ngShow directive shows or hides the given HTML element based on the |
| 30 * expression provided to the ngHide attribute. The element is shown or hidden | 29 * expression provided to the ngHide attribute. The element is shown or hidden |
| 31 * by changing the removing or adding the ng-hide CSS class onto the element. | 30 * by changing the removing or adding the ng-hide CSS class onto the element. |
| 32 */ | 31 */ |
| 33 @Decorator( | 32 @NgDirective( |
| 34 selector: '[ng-show]', | 33 selector: '[ng-show]', |
| 35 map: const {'ng-show': '=>show'}) | 34 map: const {'ng-show': '=>show'}) |
| 36 class NgShow { | 35 class NgShowDirective { |
| 37 final dom.Element element; | 36 final dom.Element element; |
| 38 final Animate animate; | |
| 39 | 37 |
| 40 NgShow(this.element, this.animate); | 38 NgShowDirective(this.element); |
| 41 | 39 |
| 42 set show(value) { | 40 set show(value) { |
| 43 if (toBool(value)) { | 41 if (toBool(value)) { |
| 44 animate.removeClass(element, NgHide.NG_HIDE_CLASS); | 42 element.classes.remove(NgHideDirective.NG_HIDE_CLASS); |
| 45 } else { | 43 } else { |
| 46 animate.addClass(element, NgHide.NG_HIDE_CLASS); | 44 element.classes.add(NgHideDirective.NG_HIDE_CLASS); |
| 47 } | 45 } |
| 48 } | 46 } |
| 49 } | 47 } |
| 50 | 48 |
| OLD | NEW |