W
W
whatislove2015-11-05 12:43:44
Angular
whatislove, 2015-11-05 12:43:44

Why doesn't gallery (Slick) work with ng-repeat on Angularjs?

1. I use slick-angularjs gallery ( vasyabigi.github.io/angular-slick/).
There is no jQuery!
2. Slider works fine like this:

<slick>
           <div>
                     <img src="{{bikes.gallery[0]}}" alt="">
          </div>
           <div>
                     <img src="{{bikes.gallery[1]}}" alt="">
          </div>
           <div>
                       <img src="{{bikes.gallery[2]}}" alt="">
          </div>
    </slick>

3. And it doesn't work like this: (i.e. the pictures themselves are displayed, but the plugin breaks completely)
No errors in the console.
<slick>
      <div ng-repeat="bikes in bike.gallery">
        <img ng-src="{{ bikes }}" alt="">
      </div>
    </slick>

4. I suspect that this is somehow related to the scope, but I can’t figure out what and how.
Help solve the problem!!!
Thank you all in advance!!!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yaroslav Lyzlov, 2015-11-05
@dixoNich

Add attribute to slick Like
this <slick init-onload="true", data="bikes"></slick>
Try it and unsubscribe.

A
Alex, 2015-11-05
@streetflush

There is no jQuery!
It's strange that in the documentation for Slick it is listed in the plug-ins ...
In general, judging by github Slick, the problem is known
Here is one of the solutions .... stackoverflow.com/questions/31108573/angular-slick...
Here are some https://github .com/vasyabigi/angular-slick/issues/105
Apparently, the pictures just don't have time to load and ng-repiat work, and the directive is already doing its dirty work...

S
SerzN1, 2015-11-05
@SerzN1

Since when did it suddenly become equivalent?
and

<div ng-repeat="bikes in bike.gallery">
<img ng-src="{{ bikes }}" alt="">
</div>

It should be something like this:
<div ng-repeat="bike in bikes.gallery">
<img ng-src="{{ bike }}" alt="">
</div>

*Head-holding emoji here*

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question