Skip to content

Commit 115e901

Browse files
devversionmmalerba
authored andcommitted
fix(ripple): explicit type for global ripple options (#4240)
Due to a bug (angular/angular#12631 (comment)), specifiying a type for a injected provider didn't work in AOT mode. This bug has been solved, but we still need to switch to a `interface` instead of a TypeScript `type`.
1 parent 9a2c4d6 commit 115e901

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib/core/ripple/ripple.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import {RippleRef} from './ripple-ref';
1717
/** OpaqueToken that can be used to specify the global ripple options. */
1818
export const MD_RIPPLE_GLOBAL_OPTIONS = new OpaqueToken('md-ripple-global-options');
1919

20-
export type RippleGlobalOptions = {
20+
export interface RippleGlobalOptions {
2121
disabled?: boolean;
2222
baseSpeedFactor?: number;
23-
};
23+
}
2424

2525
@Directive({
2626
selector: '[md-ripple], [mat-ripple], [mdRipple], [matRipple]',
@@ -82,8 +82,7 @@ export class MdRipple implements OnChanges, OnDestroy {
8282
elementRef: ElementRef,
8383
ngZone: NgZone,
8484
ruler: ViewportRuler,
85-
// Type needs to be `any` because of https://github.com/angular/angular/issues/12631
86-
@Optional() @Inject(MD_RIPPLE_GLOBAL_OPTIONS) globalOptions: any
85+
@Optional() @Inject(MD_RIPPLE_GLOBAL_OPTIONS) globalOptions: RippleGlobalOptions
8786
) {
8887
this._rippleRenderer = new RippleRenderer(elementRef, ngZone, ruler);
8988
this._globalOptions = globalOptions ? globalOptions : {};

0 commit comments

Comments
 (0)