title: Requirejs + Backbone Uncaught TypeError: Cannot read property 'Model' of undefined
body: <p>I have been starting with Backbone. I used Require to load modul and got this error. Can anyone explain this? In file user.js i have this bug when I try to create Backbone.Model.extend. I used Backbone.js 0.9.10, jQuery v1.9.0, RequireJS 2.1.4, Underscore 1.4.4. Thank you.</p>
  
  <p>index.html</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;!-- Load the script "js/main.js" as our entry point --&gt;
      &lt;script data-main="js/main.js" src="js/libs/require/require.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" type="text/css" href="stylesheets/style.css"&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;div id="container"&gt;
  
      &lt;div id="menu"&gt;&lt;/div&gt;
  
      &lt;div id="content"&gt;&lt;/div&gt;
  
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>main.js</p>
  
  <pre><code>require.config({
      paths:{
          jquery:'libs/jquery/jquery-min',
          underscore:'libs/underscore/underscore-min',
          backbone:'libs/backbone/backbone-min',
          templates:'../templates'
      }
  });
  
  require(['app'], function (App) {
      console.log('____main.js')
      App.initialize();
      console.log('main.js')
  });
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>define(['jquery', 'underscore', 'backbone', 'router'], function($, _, Backbone, Router) {
      var initialize = function(){
          Router.initialize();
          console.log('app.js');
      };
  
      return {
          initialize: initialize
      };
  });
  </code></pre>
  
  <p>router.js</p>
  
  <pre><code>define([
      'jquery',
      'underscore',
      'backbone',
      'views/home/login'
      //'views/room',
  //    'views/friend',
  //    'views/play',
  //    'views/money'
  ], function ($, _, Backbone, loginView) {
      console.log('router.js');
      var AppRouter = Backbone.Router.extend({
          routes:{
              '/home':'showHome',
              '*actions':'defaultAction'
          },
          showHome:function () {
              loginView.render();
          },
          defaultAction:function (actions) {
              console.log('No route:', actions);
          }
      });
  
      var initialize = function(){
          var app_router = new AppRouter;
          Backbone.history.start();
      };
      return {
          initialize: initialize
      };
  });
  </code></pre>
  
  <p>login.js(Backbone View)</p>
  
  <pre><code>define([
      'jquery',
      'underscore',
      'backbone',
      'collections/home/users',
      'text!templates/home/login.html'
  ], function($, _, Backbone, usersCollections, homeLoginTemplate){
      var loginView = Backbone.View.extend({
          el: $('container'),
          render: function(){
              var data = {};
              var compiledTemplate = _.template(homeLoginTemplate);
              this.el.append(compiledTemplate);
          }
      });
      console.log('login.js');
      return new loginView;
  });
  </code></pre>
  
  <p>user.js (Backbone Model)</p>
  
  <pre><code>define([
      'underscore',
      'backbone'
  ], function (_, Backbone) {
      console.log('user model');
      var userModel = Backbone.Model.extend({
          default:{
              username:"",
              password:""
          }
      });
  
      return userModel;
  });
  </code></pre>
  
  <p>users.js (Backbone Collection)</p>
  
  <pre><code>define(['underscore', 'backbone', 'models/user'], function (_, Backbone, userModel) {
      console.log('user collection');
      var usersCollection = Backbone.Collection.extend({
          model:userModel
      });
      return new usersCollection;
  });
  </code></pre>
  
  <p>I can't post my picture. But you can see in this link <a href="http://imageshack.us/photo/my-images/809/devi.jpg/">http://imageshack.us/photo/my-images/809/devi.jpg/</a>.</p>