Skip to content

Instantly share code, notes, and snippets.

@Rolilink
Created September 24, 2013 15:52
Show Gist options
  • Save Rolilink/6686935 to your computer and use it in GitHub Desktop.
Save Rolilink/6686935 to your computer and use it in GitHub Desktop.
my shim config
Folder
| Public
| | Js
| | | app
| | | | views
| | | | | topbar.js
| | | | pages
| | | | | main.js
| | | libs
| | | | backbone.js
require.config({
baseUrl: 'js',
paths:{
libs:"libs",
templates: "app/templates",
collections: "app/collections",
models: "app/models",
pages: "app/pages",
views: "app/views",
backbone: "libs/backbone"
},
shim:{
handlebars:{
exports: 'Handlebars'
},
underscore:{
exports:"_"
},
backbone:{
deps:["libs/underscore","libs/jquery"],
exports:"Backbone"
}
}
});
require(['libs/jquery','views/topbar'],function($,TopBar){
console.log($);
var topbar = new TopBar({el:$("body")});
});
define([
'libs/jquery',
'libs/underscore',
'libs/backbone',
'libs/handlebars'],
function($,_,Backbone,Handlebars){
console.log(Backbone);
/*return Backbone.View.extend({
initialize: function(){
},
render: function(){
var data = {
"logo":"tuvivi.png",
"titulo":"Tuvivi",
"subtitulo": "Certificados de regalo online",
"facebook-url": "https://www.facebook.com/tuvivicom",
"twitter-url": "https://twitter.com/tuvivi",
"instagram-url": "http://instagram.com/tuvivicom"
};
var template = Handlebars.compile(menuhbs);
$(this.el).html(template(data));
}
});*/
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment