* Close the dialog. * @param result Optional result to return to the dialog opener. * @param options Additional options to customize the closing behavior.
(result?: R, options?: DialogCloseOptions)
| 100 | * @param options Additional options to customize the closing behavior. |
| 101 | */ |
| 102 | close(result?: R, options?: DialogCloseOptions): void { |
| 103 | if (this._canClose(result)) { |
| 104 | const closedSubject = this.closed as Subject<R | undefined>; |
| 105 | this.containerInstance._closeInteractionType = options?.focusOrigin || 'program'; |
| 106 | // Drop the detach subscription first since it can be triggered by the |
| 107 | // `dispose` call and override the result of this closing sequence. |
| 108 | this._detachSubscription.unsubscribe(); |
| 109 | this.overlayRef.dispose(); |
| 110 | closedSubject.next(result); |
| 111 | closedSubject.complete(); |
| 112 | (this as {componentInstance: C}).componentInstance = ( |
| 113 | this as {containerInstance: DialogContainer} |
| 114 | ).containerInstance = null!; |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | /** Updates the position of the dialog based on the current position strategy. */ |
| 119 | updatePosition(): this { |
no test coverage detected