Topic: Modal open at start
jay2jam pro asked 6 years ago
Hello,
how can i open a modal at start, so without clicking on a button
Thx
Stefan
Arkadiusz Idzikowski staff answered 6 years ago
Hello,
There are two ways to achieve this:
1. Using the basic example
Copy the html code from the basic example, then in your ts file use ViewChild decorator to get access to the 'basicModal' template variable.
@ViewChild('basicModal') basicModal: ModalDirective;
ngAfterViewInit() {
this.basicModal.show();
}
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: 7.0.0
- Device: Mac
- Browser: Chrome
- OS: Mojave
- Provided sample code: No
- Provided link: No