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

Get the current slide ( src ) and use it outside the scope #20

Closed lexcaraig closed 7 years ago

lexcaraig commented 7 years ago

Hi, i would like to ask if something like this is possible? I am currently working on this. Any help? I really appreciate it.

<div>
    // i would actually like to put the image.preview here
</div>

<ng2-owl-carousel2
     [options]="carouselOptions">
            <div class="owl-item" *ngFor="let image of carousel; let i = index">
                <img [src]="image.cover" alt="image.title">
                 // it has image.preview
            </div>
 </ng2-owl-carousel2>

Thanks, Best Regards, Lex

lexcaraig commented 7 years ago

Hi @mujtaba01 i hope this finds you well. :) Thanks!

mujtaba01 commented 7 years ago

Hi @lexcaraig this is not possible as of now.

mujtaba01 commented 7 years ago

Closing this issue as you are using different plugin.

However this can be done by using onChanged callback in options input and the selected item index can be found by accessing event.item.index.