Topic: Opening a modal from a different modal
Arkadiusz Idzikowski staff answered 6 years ago
mdb2 pro commented 6 years ago
Sure The scenario is about switching from one modal to another from the modal itself. Assume there are login modal and fogotPassword components located at the bottom of homepage component. There is a login button in the homepage When the user clicks the login button the login modal opens. Then the user clicks forgot password in the login modal. How can I open the forget modal from the login modal ?ionyx pro answered 6 years ago
Damian Gemza staff answered 6 years ago
@ViewChild('framee') framee: ModalDirective; showForgotModal() { this.framee.show(); }
mdb2 pro commented 6 years ago
The problem is that the 'framee' is not a child of the comp where the button is Inspired by https://mdbootstrap.com/support/calling-modal-in-component-from-another-component/ I created a modal service that registers all modals globally in that service and then shows or hides them. I sent you a demo by emailFREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No