Bxslider throwing error directive `Uncaught TypeError: Cannot read the 'indexOf' property from undefined`

I use angularjs in my application, where I created a directive for bxslider. The directive code is as follows:

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 use like this $($(element[0])).bxSlider({after the ready function, since I am looking for a problem in which bxslider should work with ng-repeat , and found this solution after which bxslider works, but sometimes images do not work, t, and I always see this error.

Uncaught TypeError: Cannot read the 'indexOf' property from undefined

+4
source share
1 answer

,

angularjs, jquery- bxslider.

- jQuery .load().

bxslider.js .load(). bxslider.js.

$(this).load();

$(this).trigger('load');

kkakkurt fooobar.com/questions/1651010/...

+16

Source: https://habr.com/ru/post/1651008/


All Articles