MDB Lightbox fails to work in Angular SPA


Topic: MDB Lightbox fails to work in Angular SPA

garland.jake pro asked 8 years ago

First I built my pages separately and the MDB Lightbox worked great. I then changed my structure to take advantage of the SPA technology, loading views into the ui-view on the index page. When I do this the MDB Lightbox does not work. I have tried initializing it in an immediately invoked function, checked the path, included a script init on the actual view, on the index with the ui-view, changing the init and div to class from id in case it was clashing, but nothing works. I see my layout and thumbs perfectly, but when I click on the thumbs I just see the larger image, no lightbox. Is there a known issue using this method? Thanks

Michal Szymanski staff pro premium priority answered 8 years ago

Any bug in the console? Unfortunately I haven't heard abut such a bug before so I cannot provide you ready-to-use solution.

garland.jake pro answered 8 years ago

I managed to get it working but I had to put the script tag containing the link to the mdb.min.js file in each page where I have the gallery, together with the Init function. I don't understand why it wouldn't activate when being load into the ui-view. Another issue I am having is the carousel won't display, I see it in the DOM and it is traversing the images but it just is not visible. I'm guessing these are similar bugs, maybe they need a defer function applied, I'm not sure, but this is far from ideal, so if anyone else has a solution I'd love to hear it!! Thanks

Sebopede answered 5 years ago

I am having the same problem as garland.jake. The lightbox does not have the transition animations or the swipe compatibility. I am looking for the solution to solve this ! Please advise, thank you


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
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No