Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use select2 events? #32

Open
piernik opened this issue Oct 5, 2015 · 1 comment
Open

How to use select2 events? #32

piernik opened this issue Oct 5, 2015 · 1 comment

Comments

@piernik
Copy link

piernik commented Oct 5, 2015

How can I use select2 events like `select2-opening and so on

@piernik
Copy link
Author

piernik commented Oct 5, 2015

Here is solution You could add
After:

$timeout(function () {
    element.select2(opts);
    ...
});

Add (if it comes to change event):

if (angular.isFunction(opts.onChange)) {
    element.on("change", function (e) {
        scope.$apply(function () {
            opts.onChange(e);
        });
    });
}

And rest of the events like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant