backbone-forms amd version

44 views
Skip to first unread message

Alexandre

unread,
Oct 15, 2013, 11:48:09 AM10/15/13
to backbon...@googlegroups.com
Hi, I'm using backbone-forms amd version When my app is loading I have this error: Uncaught TypeError: Cannot call method 'template' of undefined backbone-forms.js:454 It appears that undercore is not loaded.

This is my config:

//Configuració general
var require = {
  urlArgs: "bust=" + (new Date()).getTime(),
  baseUrl: 'js',
  paths: {
    // Core Libraries
    'jquery': 'libs/jquery-1.9.1.min',
    'jqm-config': 'jqm-config',
    'jquerymobile': 'libs/jquery.mobile-1.3.2/jquery.mobile-1.3.2.min',
    'fastclick': 'libs/fastclick',
    'underscore': 'libs/underscore-min',
    'backbone': 'libs/backbone-min'
  },
  // Sets the configuration for your third party scripts that are not AMD compatible
  shim: {
    'backbone': {
      'deps': [ 'underscore', 'jquery' ],
       'exports': 'Backbone'  //attaches 'Backbone' to the window object
    },
    'jquerymobile': {
      deps: ['jquery', 'jqm-config']
    }/*,
    'backbone-forms': {
      deps: ['underscore', 'backbone']
    },*/

  }
};

//---------------------------------------------
//Backboneforms

require.paths['backbone-forms'] = 'libs/backbone-forms';
require.shim['backbone-forms'] = ['underscore', 'backbone'];


Anyone can help me please?

Phil Freo

unread,
Oct 15, 2013, 11:51:34 AM10/15/13
to backbon...@googlegroups.com
If you're using the AMD version then you don't need to include "backbone-forms" in "shims".


--
You received this message because you are subscribed to the Google Groups "Backbone-forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to backbone-form...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alexandre Busquets

unread,
Oct 15, 2013, 11:55:57 AM10/15/13
to backbon...@googlegroups.com
Ok, I removed this.
But the problem persist.


2013/10/15 Phil Freo <ph...@philfreo.com>

--
You received this message because you are subscribed to a topic in the Google Groups "Backbone-forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/backbone-forms/Zz_bUQeF7Kg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to backbone-form...@googlegroups.com.
Message has been deleted

Alexandre

unread,
Oct 15, 2013, 12:32:11 PM10/15/13
to backbon...@googlegroups.com
I solved adding this 
    'underscore': {
      'exports': '_'
      },

in shim


El dimarts 15 d’octubre de 2013 17:48:09 UTC+2, Alexandre va escriure:
Reply all
Reply to author
Forward
0 new messages