* Element to which the draggable's position will be constrained.
(boundaryElement: ElementRef<HTMLElement> | HTMLElement | null)
| 518 | * Element to which the draggable's position will be constrained. |
| 519 | */ |
| 520 | withBoundaryElement(boundaryElement: ElementRef<HTMLElement> | HTMLElement | null): this { |
| 521 | this._boundaryElement = boundaryElement ? coerceElement(boundaryElement) : null; |
| 522 | this._resizeSubscription.unsubscribe(); |
| 523 | if (boundaryElement) { |
| 524 | this._resizeSubscription = this._viewportRuler |
| 525 | .change(10) |
| 526 | .subscribe(() => this._containInsideBoundaryOnResize()); |
| 527 | } |
| 528 | return this; |
| 529 | } |
| 530 | |
| 531 | /** Sets the parent ref that the ref is nested in. */ |
| 532 | withParent(parent: DragRef<unknown> | null): this { |
no test coverage detected