Skip to content

Commit 3e99c46

Browse files
mprobsttinayuangao
authored andcommitted
fix(overlay): explicitly implement OverlayReference. (#11824)
`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.
1 parent 828b3c0 commit 3e99c46

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cdk/overlay/overlay-ref.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {take} from 'rxjs/operators';
1414
import {OverlayKeyboardDispatcher} from './keyboard/overlay-keyboard-dispatcher';
1515
import {OverlayConfig} from './overlay-config';
1616
import {coerceCssPixelValue, coerceArray} from '@angular/cdk/coercion';
17+
import {OverlayReference} from './overlay-reference';
1718

1819

1920
/** An object where all of its properties cannot be written. */
@@ -25,7 +26,7 @@ export type ImmutableObject<T> = {
2526
* Reference to an overlay that has been created with the Overlay service.
2627
* Used to manipulate or dispose of said overlay.
2728
*/
28-
export class OverlayRef implements PortalOutlet {
29+
export class OverlayRef implements PortalOutlet, OverlayReference {
2930
private _backdropElement: HTMLElement | null = null;
3031
private _backdropClick: Subject<MouseEvent> = new Subject();
3132
private _attachments = new Subject<void>();

0 commit comments

Comments
 (0)