From 07287b0ebcbecc35c9b385f5e836e3de54384a4e Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Mon, 18 Jun 2018 14:49:13 +0200 Subject: [PATCH] fix(overlay): explicitly implement OverlayReference. `OverlayRef` structurally matches `OverlayReference`, but does not explicitly implement it. That works in TypeScript, and should work in Closure Compiler through the use of `@record`, but for unclear reasons doesn't. Explicitly implementing the interface makes this code clearer, and works around the problem in Closure Compiler while that is being fixed. --- src/cdk/overlay/overlay-ref.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cdk/overlay/overlay-ref.ts b/src/cdk/overlay/overlay-ref.ts index 6db556d858b7..50fc7faa6bf8 100644 --- a/src/cdk/overlay/overlay-ref.ts +++ b/src/cdk/overlay/overlay-ref.ts @@ -14,6 +14,7 @@ import {take} from 'rxjs/operators'; import {OverlayKeyboardDispatcher} from './keyboard/overlay-keyboard-dispatcher'; import {OverlayConfig} from './overlay-config'; import {coerceCssPixelValue, coerceArray} from '@angular/cdk/coercion'; +import {OverlayReference} from './overlay-reference'; /** An object where all of its properties cannot be written. */ @@ -25,7 +26,7 @@ export type ImmutableObject = { * Reference to an overlay that has been created with the Overlay service. * Used to manipulate or dispose of said overlay. */ -export class OverlayRef implements PortalOutlet { +export class OverlayRef implements PortalOutlet, OverlayReference { private _backdropElement: HTMLElement | null = null; private _backdropClick: Subject = new Subject(); private _attachments = new Subject();