Topic: Hide/Show Modal in Typescript
BruceVWilcox pro answered 5 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 6 years ago
Damian Gemza staff commented 6 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 free 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
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Hualin Zhao priority commented 5 years ago
asdfasdfasdfasdf