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

Getting slide index #34

Closed trix87 closed 6 years ago

trix87 commented 6 years ago

Hello,

Is there any way to get the current slide index after slide change ? I tried couple of variations but none of them seem to work or i am doing something wrong.

One of them was that i added to the carousel options the following:

onDragged: this.getIndex(event)

getIndex(event){ console.log(event.item.index); }

But the onDragged got called only on slider init and never on drag and gave an undifined on slider init.

What is the proper way to get the index if that is possible?

Thanks, Trix

trix87 commented 6 years ago

Okey got it working!