Topic: Using MDB Lightbox with Angular2

Smustyle pro asked 6 years ago

Hi there, I'm creating an Angular 2 Webapp using MDB. I have some troubles including the MDB lightbox addon in a specific component. To test it I copied the whole code of the lightbox demo found on the site and pasted it into the component html template. Afterwards I tried to load the mdb-lightbox-ui.html through the following jQuery code: $("#mdb-lightbox-ui").load("./../../assets/module/mdb-addons/mdb-lightbox-ui.html"); First I added this code snippet to the body of the index.html inside a javascript script-tag. Second I added it to the ngOnInit part of the component. Unfortunately it was no successful to init the mdb lightbox. I received no error in the console or something else. The pictures are displayed correctly, but when I click on the thumbnail to move to the lightbox-view, the picture is displayed like a normal picture in the browser. (No navigation, no mask,..) Can anyone help me to resolve this? Best Regards

Piotr Bender free answered 5 years ago

Hello,In response to your issue, I wanted to let you know about just released MDBootstrap Angular kit, that may be a sufficient solution to this or any other issues you have had with Angular integration so far.The kit can be found at the following link: contains all the components you could find in MDB jQuery version.We encourage you to try it out and report any bugs or issues at with [Angular] prefix or create a thread on this forum.Have a great day!

Sebopede free commented 2 years ago

This is a follow up comment from Smustyle, the lightbox works but without any zoom transitions or swipe compatability.

Adrian Sawicki free answered 6 years ago

Hello Smustyle, I'm really sorry that you had to wait so long for the answer. Our lightbox won't work on angular2 and we don't have a fix for that yet. Currently, we started to work on angular2 version of MDB. We hope to finish it as soon as possible. Regards

Smustyle pro answered 6 years ago

I guess it's not a problem of supporting Angular2, but the lightbox must be loaded on a specific place.

Adrian Sawicki free answered 6 years ago

Hello Smustyle, Unfortunately, we aren't currently supporting Angular 2. Regards

Please insert min. 20 characters.


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


Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: No