I'm trying to get owl carousel to work in Angular.
I want to markup like this in my view, since I have many galleries :
<owl-carousel owl-options="owlOptions">
<div ng-repeat="image in gallery" class="item">
<p>hello</p>
</div>
</owl-carousel>
Basically all the directive should be doing is initalizing the carousel. The directive works perfectly, unless I use an ng-repeat. I'm guessing the directive is loading before the ng-repeat is being processed.
Does anyone have any ideas on how to solve this without building templates and directives for every style of slider?
Thank you so much!
Here is the directive:
angular.module('dir.owlCarousel', [])
.directive('owlCarousel',[function() {
return {
restrict: 'EA',
transclude: false,
scope: {
owlOptions: '='
},
link: function(scope, element, attrs) {
$(element).owlCarousel(scope.owlOptions);
}
};
}]);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…