* This method creates the overlay from the provided menu's template and saves its * OverlayRef so that it can be attached to the DOM when openMenu is called.
(menu: MatMenuPanel)
| 339 | * OverlayRef so that it can be attached to the DOM when openMenu is called. |
| 340 | */ |
| 341 | private _createOverlay(menu: MatMenuPanel): OverlayRef { |
| 342 | if (!this._overlayRef) { |
| 343 | const config = this._getOverlayConfig(menu); |
| 344 | this._subscribeToPositions( |
| 345 | menu, |
| 346 | config.positionStrategy as FlexibleConnectedPositionStrategy, |
| 347 | ); |
| 348 | this._overlayRef = createOverlayRef(this._injector, config); |
| 349 | this._overlayRef.keydownEvents().subscribe(event => { |
| 350 | if (this._menu instanceof MatMenu) { |
| 351 | this._menu._handleKeydown(event); |
| 352 | } |
| 353 | }); |
| 354 | } |
| 355 | |
| 356 | return this._overlayRef; |
| 357 | } |
| 358 | |
| 359 | /** |
| 360 | * This method builds the configuration object needed to create the overlay, the OverlayState. |
nothing calls this directly
no test coverage detected
searching dependent graphs…