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

Carousel with requirejs. Hammer is not defined #32

Open
alexey-shaposhnikov opened this issue Aug 12, 2014 · 5 comments
Open

Carousel with requirejs. Hammer is not defined #32

alexey-shaposhnikov opened this issue Aug 12, 2014 · 5 comments

Comments

@alexey-shaposhnikov
Copy link

Uncaught TypeError: undefined is not a function bootstrap-touch-carousel.js:11
g._regTouchGestures bootstrap-touch-carousel.js:11
g bootstrap-touch-carousel.js:11
(anonymous function) bootstrap-touch-carousel.js:11
m.extend.each jquery.1.11.1.js:2
m.fn.m.each jquery.1.11.1.js:2
a.fn.carousel bootstrap-touch-carousel.js:11

I'm using requirejs and it looks like hammer is not injected

@alexey-shaposhnikov alexey-shaposhnikov changed the title Carousel with requirejs. Hummer is not defined Carousel with requirejs. Hammer is not defined Aug 12, 2014
@ixisio
Copy link
Owner

ixisio commented Aug 18, 2014

@alexeyCRLNX will invest..!

@ixisio
Copy link
Owner

ixisio commented Aug 18, 2014

@alexeyCRLNX can you please paste me your bootstrap-touch-carousel.js line: 11 here..

@ixisio
Copy link
Owner

ixisio commented Oct 2, 2014

I'm using requirejs and it looks like hammer is not injected

Like bootstrap, this plugin isn't AMD ready, it only modifies the jQuery object for the additional methods. But you can add in the Bootstrap.Carousel as a module w/o declaring a parameter.

define([
    "jquery",
    "carousel"
],
function($){
    $("#carousel").carousel();
});

@jonesmac
Copy link

Can you give a better example for using this within a module? I have added this as a dependency, but it still give the undefined error and hammer.js doesn't load.

define([ 
    'jquery', 
    'bootstrap', 
    'bootstrapTouch'
], 
function (jquery) {
    var $ = jquery;
    $('#carousel-example-generic').carousel();
});

@jayanandan
Copy link

Any update on this issue. I'm facing the same issue in our application. And do we need to include hammer.js as seperate library? Or is it containing hammer.js already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants