Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Running a Modal via the TS, in the constructor instead of the HTML

Ruth free asked 4 years ago


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 ?


Arkadiusz Idzikowski staff answered 4 years ago


We explained how to create a dynamic modal in the modals documentation:

https://mdbootstrap.com/docs/angular/modals/basic/#dynamic



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: 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