I am using angularjs in my application where I have created a directive for bxslider. Below is code of directive:
angular.module('sbAdminApp') .directive('bxSlider', function(){ return{ restrict: "A", require: "ngModel", link: function(scope, element, attrs, ctrl){ element.ready(function(){ $($(element[0])).bxSlider({ maxSlides:1, auto:true, controls:false, pager:true }); }) } } })
Above I am using like this $($(element[0])).bxSlider({
after ready function as I search for a problem where bxslider should work with ng-repeat and found this solution after which bxslider is working but sometimes images doesn't load and I can see this error always.
Uncaught TypeError: Cannot read property 'indexOf' of undefined