Topic: Hide/Show Modal in Typescript
salmansahnoon pro asked 7 years ago
BruceVWilcox pro answered 6 years ago
The below link provided the answer to your question as I understood it.
https://mdbootstrap.com/docs/angular/modals/basic/#show-and-hide
The essential typescript code lines are shown below:
import { ModalDirective } from 'your path to modal directive';
...
@ViewChild('demoBasic') demoBasic: ModalDirective;
...
showAndHideModal() {
this.demoBasic.show();
}
Damian Gemza staff answered 7 years ago
Damian Gemza staff commented 7 years ago
You have to import ToastService into your component.ts file, and ToastModule in your app.module.ts. Then in imports array you have to import ToastModule.forRoot(). Best Regards, Damiandtrunk90 commented 4 years ago
How the ModalDirective
should look like? Do I really need to create an extra file/class just to call the show/hide methods?
Arkadiusz Idzikowski staff commented 4 years ago
You can also call the methods directly in the HTML template. Please take a look at our examples: https://mdbootstrap.com/docs/angular/modals/basic/
FREE 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
Hualin Zhao pro premium priority commented 5 years ago
asdfasdfasdfasdf