angular-bootstrap-slider icon indicating copy to clipboard operation
angular-bootstrap-slider copied to clipboard

Requirements for installation are not clear

Open kjaquier opened this issue 9 years ago • 11 comments

Just include slider.js and use the package ui.bootstrap-slider.

I actually had to include seiyria-bootstrap-slider/dist/bootstrap-slider.min.js and seiyria-bootstrap-slider/dist/css/bootstrap-slider.min.css too.

Also, looking at the code, I'm not sure it works without jQuery, like the original plugin is supposed to. It would really be a plus, since most angular modules for UI still require it...

kjaquier avatar Jun 23 '15 14:06 kjaquier

Yes, it is implied that bootstrap slider is already included. If you'd be willing to submit a PR on that, I'd take that.

You are correct, this does look for $.fn.slider and it is untested without jQuery. However, Angular, by default, has jqLite and IIRC if bootstrap-slider detects any jQuery namespace it will attach to it, which makes this a moot point. That said, if you have a plnkr that demonstrates this case, I'd be happy to take a look at it, but a PR would be overall a lot more helpful. As you said though, a lot of Angular plugins are just jQuery wrappers in disguise, so I'm not sure relying on jQuery is that much of a detriment.

seiyria avatar Jun 23 '15 14:06 seiyria

I second both points, it would be great if the actual installation hints would be complete. When using it without jQuery, I see an $ is not defined error in the console, so IMHO there's no automatic usage of jqLite.

tobilg avatar Jul 01 '15 10:07 tobilg

That's strange. In any event, if someone really needs the jQuery dependency to be removed, feel free to submit a PR. I suppose I'll flesh out the docs a bit more to say you do need to include bootstrap-slider (though I still feel this is a given).

seiyria avatar Jul 01 '15 12:07 seiyria

Sorry guys, but i'm not understand what are the requirements. For basic usage I need to install, bootstrap (and include the CSS), angular, angular-bootstrap-slider and? seiyria/bootstrap-slider? other package? could you give me the minimun installation required via bower command? I'm trying but i have not errors bat also i have not the slider too. Thanks

zauker avatar Sep 21 '15 13:09 zauker

Yes, you need to install bootstrap-slider. That is implied when I say:

See bootstrap-slider for examples and options.

and

You will also need to include bootstrap-sliders CSS and JS.

bower should already install seiyria-bootstrap-slider as well.

seiyria avatar Sep 21 '15 13:09 seiyria

Thank you for your fast response, I've made a little example on plunker but it doesn't works.

http://plnkr.co/edit/wumvDyTDAZiG4P2KlsLQ?p=preview

Coul'd you check if I miss something? Thanks

zauker avatar Sep 21 '15 13:09 zauker

Yes, you forgot to require the module ui.bootstrap-slider.

seiyria avatar Sep 21 '15 13:09 seiyria

Concerning ui.bootstrap-slider you mean the Angular UI Bootstrap or jQuery ones?

http://angular-ui.github.io/bootstrap/ https://jquery-ui-bootstrap.github.io/jquery-ui-bootstrap/components.html#slider

Could you kindly write me the right ui.bootstrap-slider project page (or bower or CDN link) so i'll try to add into my sample. thanks

zauker avatar Sep 21 '15 14:09 zauker

... You literally just have to add it as a module dependency, like so:

(function () {
    var app = angular.module("sliderApp", ['ui.bootstrap-slider']);

    app.controller('sliderCtrl', function($scope, $http) {
        this.sliderValue = 24;
    });
})();

You can see here that that is what I've chosen to call this module.

seiyria avatar Sep 21 '15 14:09 seiyria

Oh damn, I was checking about the files inclusions and I did not realize that I forgot to load the module. Now it works fine, thank you for your support.

zauker avatar Sep 21 '15 14:09 zauker

This is pretty obvisous, but I guess, people might forget about the module inclusion at first (I did). This might be great to add a line about it in the doc.

jice-lavocat avatar Nov 26 '15 11:11 jice-lavocat