I'm wanting to use owl slider in some directive, or in some angled view but it's not working properly, since the HTML is rendered but the jQuery is not acting.
A Owl slider, I put it in a directive, but it's not loading me. When I put it out of a directive, as a native HTML code without any relation to Angular, it works perfectly. My code is as follows:
Directive:
.directive('owlSlider', function () { return { templateUrl: '../../views/slider.html', restrict: 'AE', link: function postLink(scope, element) { $(element).owlCarousel({ navigation: true, // Show next and prev buttons slideSpeed: 300, paginationSpeed: 400, singleItem: true, navigationText: ["", ""] }); } }; });
I call the board:
//HTML <owl-slider class="owl-slider-full owl-carousel owl-theme light-pagination square-pagination dark-pagination-without-next-prev-arrow main-slider"></owl-slider>"
HTML content of the directive (is the templateUrl of the directive)
<div class="item owl-bg-img" style="background-image:url('img/slider1.jpg');"></div>