@@ -20,6 +20,7 @@ import {
20
20
} from '@angular/core' ;
21
21
import { RippleRef } from './ripple-ref' ;
22
22
import { RippleAnimationConfig , RippleConfig , RippleRenderer , RippleTarget } from './ripple-renderer' ;
23
+ import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations' ;
23
24
24
25
/** Configurable options for `matRipple`. */
25
26
export interface RippleGlobalOptions {
@@ -135,7 +136,8 @@ export class MatRipple implements OnInit, OnDestroy, RippleTarget {
135
136
constructor ( private _elementRef : ElementRef ,
136
137
ngZone : NgZone ,
137
138
platform : Platform ,
138
- @Optional ( ) @Inject ( MAT_RIPPLE_GLOBAL_OPTIONS ) globalOptions : RippleGlobalOptions ) {
139
+ @Optional ( ) @Inject ( MAT_RIPPLE_GLOBAL_OPTIONS ) globalOptions : RippleGlobalOptions ,
140
+ @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) private _animationMode ?: string ) {
139
141
140
142
this . _globalOptions = globalOptions || { } ;
141
143
this . _rippleRenderer = new RippleRenderer ( this , ngZone , _elementRef , platform ) ;
@@ -161,7 +163,9 @@ export class MatRipple implements OnInit, OnDestroy, RippleTarget {
161
163
centered : this . centered ,
162
164
radius : this . radius ,
163
165
color : this . color ,
164
- animation : { ...this . _globalOptions . animation , ...this . animation } ,
166
+ animation : this . _animationMode === 'NoopAnimations' ?
167
+ { enterDuration : 0 , exitDuration : 0 } :
168
+ { ...this . _globalOptions . animation , ...this . animation } ,
165
169
terminateOnPointerUp : this . _globalOptions . terminateOnPointerUp ,
166
170
speedFactor : this . speedFactor * ( this . _globalOptions . baseSpeedFactor || 1 ) ,
167
171
} ;
0 commit comments