Skip to content

Commit d1de6fa

Browse files
devversionmmalerba
authored andcommitted
refactor: remove abstract directives injection workaround (#18109)
Previously we had to make sure that every constructor parameter of abstract directive classes resolves to a suitable DI token. This was caused by a bug that has been solved in version 9. Hence we can remove the workaround.
1 parent 9fa5a6e commit d1de6fa

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/material-experimental/mdc-button/button-base.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@
77
*/
88

99
import {Platform} from '@angular/cdk/platform';
10-
import {
11-
Directive,
12-
ElementRef,
13-
HostListener,
14-
Inject,
15-
NgZone,
16-
Optional,
17-
ViewChild
18-
} from '@angular/core';
10+
import {Directive, ElementRef, HostListener, NgZone, ViewChild} from '@angular/core';
1911
import {
2012
CanColor,
2113
CanColorCtor,
@@ -29,7 +21,6 @@ import {
2921
mixinDisableRipple,
3022
RippleAnimationConfig
3123
} from '@angular/material/core';
32-
import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';
3324
import {numbers} from '@material/ripple';
3425

3526
/** Inputs common to all buttons. */
@@ -104,8 +95,7 @@ export class MatButtonBase extends _MatButtonBaseMixin implements CanDisable, Ca
10495

10596
constructor(
10697
elementRef: ElementRef, public _platform: Platform, public _ngZone: NgZone,
107-
// TODO(devversion): Injection can be removed if angular/angular#32981 is fixed.
108-
@Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string) {
98+
public _animationMode?: string) {
10999
super(elementRef);
110100

111101
const classList = (elementRef.nativeElement as HTMLElement).classList;
@@ -163,8 +153,7 @@ export class MatAnchorBase extends MatButtonBase {
163153
tabIndex: number;
164154

165155
constructor(elementRef: ElementRef, platform: Platform, ngZone: NgZone,
166-
// TODO(devversion): Injection can be removed if angular/angular#32981 is fixed.
167-
@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {
156+
animationMode?: string) {
168157
super(elementRef, platform, ngZone, animationMode);
169158
}
170159

0 commit comments

Comments
 (0)