Backbone Relational is not an AMD-compatible library, so I went ahead and found a usage plugin to ensure that the underline and trunk load as dependencies. Here is my configuration file
require.config({ baseUrl: '../global/js', paths: { use: 'libs/utilities/use', jquery: 'libs/jquery/jquery-min', underscore: 'libs/underscore/underscore-min', backbone: 'libs/backbone/backbone-optamd3-min', text: 'libs/require/text', relational: 'libs/backbone/backbone-relational' }, use: { "relational": { deps: ["backbone","underscore"] } } });
I also went ahead and added the Backbone relational library
(function(Backbone, _) { "use strict"; Backbone.Relational = { showWarnings: true }; })(this.Backbone, this._);
Finally, I call relational inside the model
define([ 'jquery', 'underscore', 'backbone', 'mediator', 'relational' ], function($, _, Backbone, Mediator){
I get an error, cannot set Relational property from undefined. Master's value is not available. What am I missing?
Some links that I used https://github.com/tbranyen/use.js
https://github.com/tbranyen/layoutmanager-example/blob/master/app/index.js
https://raw.github.com/PaulUithol/Backbone-relational/master/backbone-relational.js
imrane
source share