0

I'm using a combination of Backbone, RequireJS & Backbone-MVC (http://chance-an.github.io/backbone-mvc/#root/index).

But when I'm trying to use Backbone-MVC it returns a null.

Here's a list with all my javascript files

When I console log the MVC variable in Router it returns a null. Can somebody find the problem?

Thanks!

1 Answer 1

1

you try with this code.

require.config({
  paths: {
    jquery:       'libs/jquery/jquery-min',
    bootstrap:    'libs/bootstrap/bootstrap-min',
    underscore:   'libs/underscore/underscore-min',
    backbone:     'libs/backbone/backbone-min',
    backbonemvc:  'libs/backbone/backbone-mvc',  
    templates:    '../templates'
  },
  shim:{
      'backbone': {
          deps: ["underscore", "jquery"],
          exports: "Backbone"
     },
      'backbonemvc': {
           deps: ["backbone"],
           exports: "MVC"
     }

  }
});

The shim config can be wrong.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for your reply. I just tested this, but that didn't solve the problem. I tried it at my main.js file, but it returns null. Code: pastebin.com/6Ez67RGS
Hi, you see this link: tutorial. The creator of BackboneMVC did a little tutorial as integrate BackboneMVC with Require.js.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.