mujtaba01 / ngx-owl-carousel

An angular2 (4) wrapper for jquery owl-carousel library with dynamic carousel item change detection
MIT License
70 stars 25 forks source link

Listening Owl Carousel 2 Events #6

Closed labibramadhan closed 7 years ago

labibramadhan commented 7 years ago

How to listen to Owl Carousel 2 Events?

I have tried something like this:

ngAfterViewInit() {
  const owl = $(this._elementRef.nativeElement).find('owl-carousel-child').data('owl.carousel');
  owl.on('onResize, onResized, onInitialize, onInitialized, onChange, onChanged, onDrag', console.log);
}

But nothing triggered

mujtaba01 commented 7 years ago

Instead of listening to Owl Carousel events you can pass the callback in options input.

labibramadhan commented 7 years ago

Thank you! it works.