Topic: Carousel change slide programmatically

bitjuice pro asked 4 years ago


Hi,

I need to change current slide of a carousel programatically, using previousSlide() and nextSlide() methods.

Could you give me an example of how I can call this methods please?

Thanks

Marco


Damian Gemza staff answered 4 years ago


Dear @bitjuice

You have to use those methods from the CarouselComponent class.

Add the template reference (# sign) to the mdb-carousel element, and then use the ViewChild class to get the CarouselComponent class instance, and with this, you're able to call the previousSlide() and nextSlide() methods.

Best Regards,

Damian


bitjuice pro commented 4 years ago

Thanks Damian, now it works



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 8.0.0
  • Device: PC
  • Browser: Chorme
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No