Nair
Nair

Reputation: 7458

Why am I unable to create jQuery UI controls in MeteorJS?

I first tried out the source code as it is (by creating just HTML) mentioned in https://jqueryui.com/slider. I was able to see the slider in the browser. Next I wanted to try to show the same slider using MeterorJS by following http://www.andrehonsberg.com/article/meteorjs_jquery_sliders_use_document_ready document. I keep getting "Exception from Deps afterFlush function function: TypeError: Object [object Object] has no method 'slider'.

<template name="hello">
<div id="slider"></div>
</template>

I added the reference as well

 <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

javascript:

Template.hello.rendered = function() {
$("#slider").slider();
}

Not sure what am I doing wrong here.

** Edit, I did add jQuery-ui using mrt add still not working, but the exception is gone now.

Upvotes: 0

Views: 137

Answers (1)

Paul Ellery
Paul Ellery

Reputation: 1745

Don't add the references, instead use the meteorite smart package for jquery-ui:

mrt add jquery-ui

Upvotes: 1

Related Questions