angular-ui / ui-slider

jQuery UI Slider for AngularJS
https://htmlpreview.github.io/?https://github.com/angular-ui/ui-slider/master/demo/index.html
MIT License
265 stars 176 forks source link

elm.slider is not a function #88

Closed webmajstr closed 8 years ago

webmajstr commented 9 years ago

I'm getting error: "elm.slider is not a function" in 44 line of code. It disappears, after i replace:

elm.slider(options);

with

$(elm).slider(options);

but i think it should not be a case. In view declaring slider looks as following:

<div ui-slider="slider.sliderC.options" 
         min="0" 
         max="50" 
         ng-model="sliderValues.valuesC"></div>
PabloRomanH commented 9 years ago

Same problem, but replacing with

$(elm).slider(options);

doesn't help.

PabloRomanH commented 9 years ago

Sorry, didn't realize it depended on jQuery UI.

PowerKiKi commented 9 years ago

I would think that @webmajstr original issue might have something to do with inclusion order. jQuery must be included before Angular, so Angular can pick it up and use it instead of jQlite... that could explain why the element does not seem to be wrapped by the real jQuery...

HectorRPL commented 7 years ago

Same error. but I using "yo angular fullstack" how can solve this problem? only I put ui-slider in div tag in html and the error appears. Today the scripts tags to control load order files in index.html is no more used. May be must solve this problem from root, I mean; with npm/bower instalation, I dont know.

angular.js:13920 TypeError: elm.slider is not a function
    at init (slider.js:46)
    at slider.js:55
    at angular.js:8340
    at Scope.$eval (angular.js:17682)
    at Scope.$digest (angular.js:17495)
    at Scope.$apply (angular.js:17790)
    at bootstrapApply (angular.js:1761)
    at Object.invoke (angular.js:4718)
    at doBootstrap (angular.js:1759)
    at Object.bootstrap (angular.js:1779)
    at app.js:56
    at HTMLDocument.trigger (angular.js:3207)
    at defaultHandlerWrapper (angular.js:3497)
    at HTMLDocument.eventHandler (angular.js:3485)

Why only with this library is this error, I have more libreries and no problem, only with this ui-slider I am in very problems with this library