I am getting the following error when I use bootstrap slider (https://github.com/seiyria/bootstrap-slider) in my Electron(http://electron.atom.io/docs/latest/tutorial/quick-start/) app :
"Uncaught TypeError: $(...).Slider is not a function"
Earlier I was also struggling with using Jquery but solved it using : https://github.com/atom/electron/issues/254 :
window.$ = window.jQuery = require('/path/to/jquery'); instead of regular :
The reason quoted was Query contains something along this lines:
if ( typeof module === "object" && typeof module.exports === "object" ) {
// set jQuery in `module`
} else {
// set jQuery in `window`
}
I don't understand what is the right way to use it for bootstrap the slider.
I could see that bootstrap-slider.js has a component dealing with "module" which might be causing the anomaly just like in jquery.
(function(root, factory) {
if(typeof define === "function" && define.amd) {
define(["jquery"], factory);
} else if(typeof module === "object" && module.exports) {
var jQuery;
try {
jQuery = require("jquery");
} catch (err) {
jQuery = null;
}
module.exports = factory(jQuery);
} else {
root.Slider = factory(root.jQuery);
}
Please tell me how to deal with this.