htoniv
htoniv

Reputation: 1668

Bind scroll event to select element using angularjs

I am new to angularjs. And i dont know how to bind scroll event to the html element select.this is my directive to adding scrolling functionality.

myApp.directive('scrolly', function () {
    return {
        restrict: 'A',
        link: function (scope, element, attrs) {
            var raw = element[0];
            console.log(element[0]);
            element.bind('scroll', function () {
                console.log('inside scroll');
            });
        }
    };
});

Here I attached my fiddle link.Please someone help me to fix this issue.

Upvotes: 0

Views: 650

Answers (1)

floribon
floribon

Reputation: 19183

There is no HTML event fired when you scroll through a select box as it is rendered by your operating system and not the browser.

If you really need to catch this behavior, you should use a HTML select element, such as the popular select2 or selectize libraries.

Upvotes: 1

Related Questions