Topic: how to put the modal code in an extra component

just gischy free asked 6 years ago


hello,

i have an application, app.component.html hold the structure of the main page. currently my modals are also inside the app.component.html...

now the application gets slow because huge modals are rendered when calling the app.component.html even if they are not shown...

how can i seperate my modal code into an extra component? as a result i want the modals be rendered just when they are called to show..

thanks in advance!


Damian Gemza staff commented 6 years ago

Dear just gischy, It's simple to achieve. Just create another component, put there code of your desired modal, and in your app.component make some *ngIf directive to check, if modal should be shown or not. Best Regards, Damian

ak.leimrey pro commented 6 years ago

Well, as you create ANY component. Create a modal component, that is solely responsible for the modal content and call it in your app.component.html like "<app-modal-content></app-modal-content>


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Opened

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags