MaterialPopupComponent constructor

MaterialPopupComponent(
  1. @Optional() @SkipSelf() PopupHierarchy? _hierarchy,
  2. @Optional() @SkipSelf() MaterialPopupComponent? parentPopup,
  3. @Attribute('role') String? role,
  4. NgZone _ngZone,
  5. OverlayService _overlayService,
  6. DomService _domService,
  7. ZIndexer _zIndexer,
  8. @Inject(defaultPopupPositions) List<RelativePosition> _defaultPreferredPositions,
  9. @Inject(overlayRepositionLoop) Object useRepositionLoop,
  10. @Inject(overlayViewportBoundaries) Object viewportBoundaries,
  11. @Optional() PopupSizeProvider? _popupSizeProvider,
  12. ChangeDetectorRef _changeDetector,
  13. ViewContainerRef _viewContainer,
  14. Element elementRef,
)

Implementation

MaterialPopupComponent(
    @Optional() @SkipSelf() this._hierarchy,
    @Optional() @SkipSelf() MaterialPopupComponent? parentPopup,
    @Attribute('role') String? role,
    this._ngZone,
    this._overlayService,
    this._domService,
    this._zIndexer,
    @Inject(defaultPopupPositions) this._defaultPreferredPositions,
    @Inject(overlayRepositionLoop) Object useRepositionLoop,
    @Inject(overlayViewportBoundaries) Object viewportBoundaries,
    @Optional() this._popupSizeProvider,
    this._changeDetector,
    this._viewContainer,
    this.elementRef)
    : this.role = role ?? 'dialog' {
  // Close popup if parent closes.

  if (parentPopup != null) {
    _disposer
        .addStreamSubscription(parentPopup.onClose.listen((_) => close()));
  }

  if (useRepositionLoop is bool) {
    _useRepositionLoop = useRepositionLoop;
  }

  if (viewportBoundaries is Box) {
    _viewportBoundaries = viewportBoundaries;
  }

  // Create the PopupRef for the ACX focus library.
  _resolvedPopupRef = MaterialPopupRef(this);
}