| OLD | NEW |
| (Empty) |
| 1 part of angular.animate; | |
| 2 | |
| 3 /** | |
| 4 * This provides DOM controls for turning animations on and off for individual | |
| 5 * dom elements. Valid options are [always] [never] and [auto]. If this | |
| 6 * directive is not applied the default value is [auto] for animation. | |
| 7 */ | |
| 8 @Decorator(selector: '[ng-animate]', | |
| 9 map: const {'ng-animate': '@option'}) | |
| 10 class NgAnimate extends AbstractNgAnimate { | |
| 11 set option(value) { | |
| 12 _option = value; | |
| 13 _optimizer.alwaysAnimate(_element, _option); | |
| 14 } | |
| 15 | |
| 16 NgAnimate(dom.Element element, AnimationOptimizer optimizer) | |
| 17 : super(element, optimizer); | |
| 18 } | |
| 19 | |
| 20 /** | |
| 21 * This provides DOM controls for turning animations on and off for child | |
| 22 * dom elements. Valid options are [always] [never] and [auto]. If this | |
| 23 * directive is not applied the default value is [auto] for animation. | |
| 24 * | |
| 25 * Values provided in [ng-animate] will override this directive since they are | |
| 26 * more specific. | |
| 27 */ | |
| 28 @Decorator(selector: '[ng-animate-children]', | |
| 29 map: const {'ng-animate-children': '@option'}) | |
| 30 class NgAnimateChildren extends AbstractNgAnimate { | |
| 31 set option(value) { | |
| 32 _option = value; | |
| 33 _optimizer.alwaysAnimateChildren(_element, _option); | |
| 34 } | |
| 35 | |
| 36 NgAnimateChildren(dom.Element element, AnimationOptimizer optimizer) | |
| 37 : super(element, optimizer); | |
| 38 } | |
| 39 | |
| 40 /** | |
| 41 * Base class for directives that control animations with an | |
| 42 * [AnimationOptimizer]. | |
| 43 */ | |
| 44 abstract class AbstractNgAnimate implements DetachAware { | |
| 45 final AnimationOptimizer _optimizer; | |
| 46 final dom.Element _element; | |
| 47 | |
| 48 String _option = "auto"; | |
| 49 String get option => _option; | |
| 50 set option(value); | |
| 51 | |
| 52 AbstractNgAnimate(this._element, this._optimizer); | |
| 53 | |
| 54 detach() { | |
| 55 _optimizer.detachAlwaysAnimateOptions(_element); | |
| 56 } | |
| 57 } | |
| OLD | NEW |