Class IgxOverlayService

Documentation The overlay service allows users to show components on overlay div above all other elements in the page.

Hierarchy

  • IgxOverlayService

Implements

  • OnDestroy

Index

Constructors

  • new IgxOverlayService(_factoryResolver: ComponentFactoryResolver, _appRef: ApplicationRef, _injector: Injector, builder: AnimationBuilder, document: any, _zone: NgZone, platformUtil: PlatformUtil, animationService: AnimationService): IgxOverlayService

Properties

animationStarting: EventEmitter<OverlayAnimationEventArgs> = ...

Emitted just before the overlay animation start.

animationStarting(event: OverlayAnimationEventArgs){
const animationStarting = event;
}
closed: EventEmitter<OverlayEventArgs> = ...

Emitted after the overlay content is closed and all animations are finished.

closed(event: OverlayEventArgs){
const closed = event;
}
closing: EventEmitter<OverlayClosingEventArgs> = ...

Emitted just before the overlay content starts to close.

closing(event: OverlayCancelableEventArgs){
const closing = event;
}
contentAppended: EventEmitter<OverlayEventArgs> = ...

Emitted after the content is appended to the overlay, and before animations are started.

contentAppended(event: OverlayEventArgs){
const contentAppended = event;
}
opened: EventEmitter<OverlayEventArgs> = ...

Emitted after the overlay content is opened and all animations are finished.

opened(event: OverlayEventArgs){
const opened = event;
}
opening: EventEmitter<OverlayCancelableEventArgs> = ...

Emitted just before the overlay content starts to open.

opening(event: OverlayCancelableEventArgs){
const opening = event;
}

Methods

  • attach(element: ElementRef<any>, settings?: OverlaySettings): string
  • attach(component: Type<any>, settings?: OverlaySettings, moduleRef?: { componentFactoryResolver: ComponentFactoryResolver; injector: Injector }): string
  • Generates Id. Provide this Id when call show(id) method

    Parameters

    • element: ElementRef<any>
    • Optional settings: OverlaySettings

      Display settings for the overlay, such as positioning and scroll/close behavior.

    Returns string

    Id of the created overlay. Valid until detach is called.

  • Generates Id. Provide this Id when call show(id) method

    Parameters

    • component: Type<any>

      Component Type to show in overlay

    • Optional settings: OverlaySettings

      Display settings for the overlay, such as positioning and scroll/close behavior.

    • Optional moduleRef: { componentFactoryResolver: ComponentFactoryResolver; injector: Injector }

      Optional reference to an object containing Injector and ComponentFactoryResolver that can resolve the component's factory

      • componentFactoryResolver: ComponentFactoryResolver
      • injector: Injector

    Returns string

    Id of the created overlay. Valid until detach is called.

  • detach(id: string): void
  • detachAll(): void
  • hide(id: string, event?: Event): void
  • hideAll(): void
  • reposition(id: string): void
  • setOffset(id: string, deltaX: number, deltaY: number): void
  • Offsets the content along the corresponding axis by the provided amount

    Parameters

    • id: string

      Id to offset overlay for

    • deltaX: number

      Amount of offset in horizontal direction

    • deltaY: number

      Amount of offset in vertical direction

      this.overlay.setOffset(id, deltaX, deltaY);
      

    Returns void

  • Creates overlay settings with auto, connected or elastic position strategy and preset position settings

    Parameters

    • target: HTMLElement | Point

      Attaching target for the component to show

    • Optional position: RelativePosition

      Preset position settings. By default the element is positioned below the target, left aligned.

    • Optional strategy: RelativePositionStrategy

      The relative position strategy to be applied to the overlay settings. Default is Auto positioning strategy.

    Returns OverlaySettings

    Non-modal overlay settings based on the provided target, strategy and position.