Skip to content

Commit 1856f8e

Browse files
committed
Wrap initializing function call in $timeout
In case the elements to be slided are generated using nested transcluded angular directives (including ng-repeat) the slick initialization happens before all elements are available in the DOM. As an example see https://github.com/vasyabigi/angular-slick/blob/master/dist/slick.js which also uses the $timeout approach.
1 parent 7fb0e31 commit 1856f8e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/slick.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ angular
143143
return slick.slideHandler(currentIndex);
144144
}
145145
});
146-
147-
slickness.slick(options);
146+
$timeout(function() {
147+
slickness.slick(options);
148+
});
148149
}
149150

150151
scope.internalControl = options.method || {};

0 commit comments

Comments
 (0)