Content
View differences
Updated by Aleix Suau over 5 years ago
Right now we need to extend the OpModalComponent class in order to get a modal. This leads to modal components that have nothing to do with the modal but passing some configuration to it (closeOnEscape, closeOnOutsideClick), generating tight coupling, code repetition, or lack of isolation.
Ideally, the modal shouldn't know anything about the component that it hosts and should provide a clear API to configure, open, close... it through a service. Either way, the components (the one who calls the modal or the one that is rendered on it) shouldn't know anything about the modal and just inject its service to access the functionality.
Extend the modal so it:
* [x] Accepts a configuration object so there is no need to extend it to customize actions.
* [ ] Is able to return data when it is closed.
Ideally, the modal shouldn't know anything about the component that it hosts and should provide a clear API to configure, open, close... it through a service. Either way, the components (the one who calls the modal or the one that is rendered on it) shouldn't know anything about the modal and just inject its service to access the functionality.
Extend the modal so it:
* [x] Accepts a configuration object so there is no need to extend it to customize actions.
* [ ] Is able to return data when it is closed.