@@ -20,6 +20,7 @@ import {
2020} from '@angular/core' ;
2121import { RippleRef } from './ripple-ref' ;
2222import { RippleAnimationConfig , RippleConfig , RippleRenderer , RippleTarget } from './ripple-renderer' ;
23+ import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations' ;
2324
2425/** Configurable options for `matRipple`. */
2526export interface RippleGlobalOptions {
@@ -135,7 +136,8 @@ export class MatRipple implements OnInit, OnDestroy, RippleTarget {
135136 constructor ( private _elementRef : ElementRef ,
136137 ngZone : NgZone ,
137138 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 ) {
139141
140142 this . _globalOptions = globalOptions || { } ;
141143 this . _rippleRenderer = new RippleRenderer ( this , ngZone , _elementRef , platform ) ;
@@ -161,7 +163,9 @@ export class MatRipple implements OnInit, OnDestroy, RippleTarget {
161163 centered : this . centered ,
162164 radius : this . radius ,
163165 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 } ,
165169 terminateOnPointerUp : this . _globalOptions . terminateOnPointerUp ,
166170 speedFactor : this . speedFactor * ( this . _globalOptions . baseSpeedFactor || 1 ) ,
167171 } ;
0 commit comments