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

The ionRange directive only support initialize the plugin #1

Open
santiblanko opened this issue Mar 20, 2015 · 0 comments
Open

The ionRange directive only support initialize the plugin #1

santiblanko opened this issue Mar 20, 2015 · 0 comments

Comments

@santiblanko
Copy link

My modification:

    return {
        restrict: 'AE', //attribute or element
        scope: {
            ngModel: '='
        },
        template: '<div></div>',
        replace: true,
        transclude: true,

        link: function(scope, element, attributes) {

            $(element).ionRangeSlider(scope.ngModel);

            var slider = $(element).data("ionRangeSlider");

            slider.update({
                 keyboard: true,
                 grid:true,
                onFinish: function(data) {
                    scope.ngModel.from = data.from;
                    $timeout(function() {
                        scope.$apply();
                    });
                }
            });

            scope.$watchCollection('ngModel', function(newValue, oldValue) {
                if (newValue !== oldValue) {
                    slider.update(newValue);
                }
            });

        }
    };
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