1// src/app/shared/utils/dialog.utils.ts 2function setupDialogCloseListener(dialogRef, contentInstanceType) { 3 const openedSubscription = dialogRef.afterOpened().subscribe(() => { 4 const instance = dialogRef.componentInstance; 5 const contentInstance = instance?.contentComponentRef?.instance; 6 if (contentInstance instanceof contentInstanceType) { 7 const typedContent = contentInstance; 8 if (typedContent.closeModal) { 9 const closeModalSubscription = typedContent.closeModal.subscribe(() => { 10 dialogRef.close(); 11 }); 12 dialogRef.afterClosed().subscribe(() => { 13 closeModalSubscription.unsubscribe(); 14 }); 15 } 16 } 17 }); 18 return openedSubscription; 19} 20var DialogUtils = class { 21 /** 22 * Sets up a subscription to close a dialog when its content instance emits a closeModal event 23 * @param dialogRef The dialog reference to close 24 * @param contentInstanceType The expected type of the content instance 25 * @returns Subscription that can be used for cleanup 26 */ 27 static setupCloseListener(dialogRef, contentInstanceType) { 28 return setupDialogCloseListener(dialogRef, contentInstanceType); 29 } 30}; 31 32export { 33 DialogUtils 34}; 35//# sourceMappingURL=chunk-S7NVN3GR.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.