windows 10 pro office 2019 pro office 365 pro windows 10 home windows 10 enterprise office 2019 home and business office 2016 pro windows 10 education visio 2019 microsoft project 2019 microsoft project 2016 visio professional 2016 windows server 2012 windows server 2016 windows server 2019 Betriebssysteme office software windows server https://softhier.com/ instagram takipçi instagram beğeni instagram görüntüleme instagram otomatik beğeni facebook beğeni facebook sayfa beğenisi facebook takipçi twitter takipçi twitter beğeni twitter retweet youtube izlenme youtube abone instagram

How to set up a simple Backbone/Marionette project and their dependencies using require.js

Asked By: Anonymous

I’ve been reading a lot on this, and even bought a book specifically on setting up marionette apps with require.js, and followed this little how-to on github which seemed pretty straightforward… However for some reason I can’t seem to get something as simple as starting an empty Marionette project to work!

My project is structured like so:

  • Root Directory
    • models
    • views
    • libs
      • babysitter.js
      • backbone.js
      • jquery.js
      • marionette.js
      • require.js
      • text.js
      • tpl.js
      • underscore.js
      • wreqr.js
    • collections
    • templates
    • index.html
    • main.js

Here’s my index.html:

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<a href="http://libs/require.js">http://libs/require.js</a>
</body>
</html>

And my main.js:

require.config({
    paths:{
    jquery:"libs/jquery",
    underscore: "libs/underscore",
    backbone: "libs/backbone",
    text: "libs/text",
    tpl: "libs/tpl",
    marionette: 'libs/marionette',
    'backbone.wreqr' : 'libs/wreqr',
    'backbone.babysitter' : 'libs/babysitter'
    },
    shim:{
    underscore:{
        exports: "_"
    },
    backbone:{
        deps: ['underscore','jquery'],
        exports:'Backbone'
    }
    }
});

require(['marionette'],function(Marionette){


var Application = new Marionette.Application();

Application.on("initialize:after", function(){
    alert("Application has started!");
});

    Application.start();
});

I downloaded the AMD / RequireJS version of Marionette.js from their site

Upon opening up index.html in a browser, I see an error in the console “Reference Error: Backbone is not defined” (on marionette.js line 20)

What am I doing wrong?


Solution

Answered By: Anonymous

Marionette requires backbone so either add marionette to your shim or to your require call,

shim:{
  marionette : ['backbone'],
  ...
}

or

require(['backbone', 'marionette'],function(Backbone, Marionette){

techinplanet staff


Windows 10 Kaufen Windows 10 Pro Office 2019 Kaufen Office 365 Lizenz Windows 10 Home Lizenz Office 2019 Home Business Kaufen windows office 365 satın al follower kaufen instagram follower kaufen porno
Alanya escort Manavgat escort Fethiye escort Kemer escort Didim escort http://www.kadinescort.net Gaziantep escort Denizli escort Adana escort Hatay escort Aydın escort İzmir escort Ankara escort Antalya escort Bursa escort İstanbul escort Kocaeli escort Konya escort Muğla escort Malatya escort Kayseri escort Mersin escort Samsun escort Sinop escort Tekirdağ escort Eskişehir escort Yalova escort Rize escort Amasya escort Balıkesir escort Çanakkale escort Bolu escort Erzincan escort Şırnak escort Van escort Yozgat escort Zonguldak escort Afyon escort Adıyaman escort Bilecik escort Aksaray escort Ağri escort Bitlis escort Siirt escort Çorum escort Burdur escort Diyarbakir escort Edirne escort Düzce escort Erzurum escort Kırklareli escort Giresun escort Kilis escort Kars escort Karabük escort Kırıkkale escort Mardin escort Kırşehir escort Maraş escort Manisa escort Muş escort Kastamonu escort Ordu escort Nevşehir escort Sakarya escort Osmaniye escort Şanliurfa escort Sivas escort Trabzon escort Tokat escort Ardahan escort Bartın escort Karaman escort Batman escort Bayburt escort Bingöl escort Elaziğ escort Gümüşhane escort Hakkari escort Isparta escort Uşak escort Igdır escort