Skip to content

Conversation

georgmu
Copy link

@georgmu georgmu commented Aug 19, 2025

Before this change, the ModalService.create() was not type-safe. It introduced a type T, but never used it.

This merge request solves this by correctly typing the created type, allowing access to the instance.

Additionally, this change also types the return value emitted by BaseModal.closeModal().

This allows a type-safe data passing on close.

class MyModal extends BaseModal<MyModalReturnType> {
...
}
const componentRef = this.modalService.create({ component: MyModal });
componentRef.instance.close.subscribe((result) => {
    // result is of type MyModalReturnType or undefined
}

Changelog

Changed

  • make ModalService type-safe
  • convert DataPassingModal to use type-safe infrastructure

@georgmu georgmu requested a review from a team as a code owner August 19, 2025 12:39
Copy link

netlify bot commented Aug 19, 2025

Deploy Preview for carbon-components-angular ready!

Name Link
🔨 Latest commit fc5593e
🔍 Latest deploy log https://app.netlify.com/projects/carbon-components-angular/deploys/68a59a52ba6ab40008667d70
😎 Deploy Preview https://deploy-preview-3166--carbon-components-angular.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

github-actions bot commented Aug 19, 2025

DCO Assistant Lite bot All contributors have signed the DCO.

@georgmu
Copy link
Author

georgmu commented Aug 19, 2025

I have read the DCO document and I hereby sign the DCO.

@georgmu
Copy link
Author

georgmu commented Aug 19, 2025

recheck

it is now possible to create a modal and return a correctly typed
ComponentRef.

The BaseModal class is now also typed, allowing a correctly typed output
value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant