我想重新初始化光滑的滑块,所以我为destroy和init创建了以下方法。但它对我不起作用请建议我从控制器重新初始化滑块的任何解决方案
$scope.initSlick = function () {
$scope.slickConfig2Loaded = true;
$scope.slickConfig2 = {
autoplay: true,
infinite: false,
autoplaySpeed: 2000,
slidesToShow: 5,
slidesToScroll: 5,
waitForAnimate: false,
method: {}
};
}
$scope.destroySlick = function () {
if ($scope.slickConfig2Loaded) {
$scope.slickConfig2.method.unslick();
}
}