Skip to content

Commit e6e6d6f

Browse files
authored
refactor(tooltip): change deprecated APIs for version 10 (#19364)
Changes an API that was marked for deprecation in v10. BREAKING CHANGES: * The `_hammerLoader` paramter has been removed from the `MatTooltip` constructor.
1 parent 2defaf7 commit e6e6d6f

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/material/schematics/ng-update/data/constructor-checks.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ export const constructorChecks: VersionChanges<ConstructorChecksUpgradeData> = {
3030
{
3131
pr: 'https://github.com/angular/components/pull/19324',
3232
changes: ['MatAutocompleteTrigger']
33+
},
34+
{
35+
pr: 'https://github.com/angular/components/pull/19363',
36+
changes: ['MatTooltip']
3337
}
3438
],
3539
[TargetVersion.V9]: [

src/material/tooltip/tooltip.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,7 @@ export class MatTooltip implements OnDestroy, OnInit {
255255
@Inject(MAT_TOOLTIP_SCROLL_STRATEGY) scrollStrategy: any,
256256
@Optional() private _dir: Directionality,
257257
@Optional() @Inject(MAT_TOOLTIP_DEFAULT_OPTIONS)
258-
private _defaultOptions: MatTooltipDefaultOptions,
259-
/**
260-
* @deprecated _hammerLoader parameter to be removed.
261-
* @breaking-change 9.0.0
262-
*/
263-
// Note that we need to give Angular something to inject here so it doesn't throw.
264-
@Inject(ElementRef) _hammerLoader?: any) {
258+
private _defaultOptions: MatTooltipDefaultOptions) {
265259

266260
this._scrollStrategy = scrollStrategy;
267261

tools/public_api_guard/material/tooltip.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ export declare class MatTooltip implements OnDestroy, OnInit {
3232
[key: string]: any;
3333
});
3434
touchGestures: TooltipTouchGestures;
35-
constructor(_overlay: Overlay, _elementRef: ElementRef<HTMLElement>, _scrollDispatcher: ScrollDispatcher, _viewContainerRef: ViewContainerRef, _ngZone: NgZone, _platform: Platform, _ariaDescriber: AriaDescriber, _focusMonitor: FocusMonitor, scrollStrategy: any, _dir: Directionality, _defaultOptions: MatTooltipDefaultOptions,
36-
_hammerLoader?: any);
35+
constructor(_overlay: Overlay, _elementRef: ElementRef<HTMLElement>, _scrollDispatcher: ScrollDispatcher, _viewContainerRef: ViewContainerRef, _ngZone: NgZone, _platform: Platform, _ariaDescriber: AriaDescriber, _focusMonitor: FocusMonitor, scrollStrategy: any, _dir: Directionality, _defaultOptions: MatTooltipDefaultOptions);
3736
_getOrigin(): {
3837
main: OriginConnectionPosition;
3938
fallback: OriginConnectionPosition;
@@ -52,7 +51,7 @@ export declare class MatTooltip implements OnDestroy, OnInit {
5251
static ngAcceptInputType_hideDelay: NumberInput;
5352
static ngAcceptInputType_showDelay: NumberInput;
5453
static ɵdir: i0.ɵɵDirectiveDefWithMeta<MatTooltip, "[matTooltip]", ["matTooltip"], { "position": "matTooltipPosition"; "disabled": "matTooltipDisabled"; "showDelay": "matTooltipShowDelay"; "hideDelay": "matTooltipHideDelay"; "touchGestures": "matTooltipTouchGestures"; "message": "matTooltip"; "tooltipClass": "matTooltipClass"; }, {}, never>;
55-
static ɵfac: i0.ɵɵFactoryDef<MatTooltip, [null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, null]>;
54+
static ɵfac: i0.ɵɵFactoryDef<MatTooltip, [null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
5655
}
5756

5857
export declare const matTooltipAnimations: {

0 commit comments

Comments
 (0)