File

overlay/src/overlay/overlay.config.ts

Description

Configuration for the overlay service. See OverlayService for more information.

Index

Properties

Properties

Optional data
Type : T

Additional data to be passed to the overlay component.

Example :
const overlayRef = this.overlayService.open(OverlayComponent, {
  data: {
    title: 'Overlay Demo Title',
    subTitle: 'Overlay Demo Subtitle',
    },
 });

The data can be accessed in the overlay component as follows:

Example :
export class OverlayComponent {
  constructor(private overlayRef: OverlayRef, config: OverlayConfig) {
    console.log(config.data.title); // 'Overlay Demo Title'
    console.log(config.data.subTitle); // 'Overlay Demo Subtitle'
  }
}
Optional preventCloseOnEscape
Type : boolean

Prevents the overlay to be closed by hitting the 'Escape' key.

If set to true, the overlay will not be closed by hitting the 'Escape' key but only by calling the close() method on the overlayRef.

results matching ""

    No results matching ""