Topic: Running a Modal via the TS, in the constructor instead of the HTML
I want to call the modal from the constructor in the .ts, instead of calling it from the html. This is the example
<button type="button" mdbBtn color="default" rounded="true" data-toggle="modal" data-target="#basicExample" (click)="frame.show()" mdbWavesEffect>Launch Modal</button>
I'm trying to call frame.show() from the constructor, by adding @viewChild, it doesn't work...... Any idea ?
We explained how to create a dynamic modal in the modals documentation:
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: 10.0.0
- Device: i5
- Browser: google chrome
- OS: windows
- Provided sample code: No
- Provided link: No