Slick Carousel with Angular 2

前端 未结 2 1997
星月不相逢
星月不相逢 2020-12-14 08:22

Hi I\'m starting with Angular 2 and trying to make this carousel plugin to work: slick

After a while I managed to make it work like a Component like this:

         


        
2条回答
  •  独厮守ぢ
    2020-12-14 09:13

    In my case the trick with *ngIf was not enough. Im calling REST service in ngOnInit and receiving response where in subscription I'm defining the array. The only possible workaround for me was to add slick items manually by slick function 'slickAdd' directly from typescript.

    jQuery('.my-slick').slick('slickAdd', '

    ahoj

    ');

    Maybe it will help somebody...

提交回复
热议问题