Created
January 27, 2012 22:17
-
-
Save BarDev/1691229 to your computer and use it in GitHub Desktop.
example for http://stackoverflow.com/questions/9039053/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'jquery', | |
'backbone', | |
'docsMetro' | |
], | |
function ($, Backbone, docsMetro) { | |
//Main Dashboard View | |
var Dashboard = Backbone.View.extend({ | |
el: $('#mainContent'), | |
events: { | |
}, | |
initialize: function () { | |
console.log('test'); | |
console.log(docsMetro); | |
//Validate User Here most likely. Each of the main view's for each app should probably call the same validation function | |
}, | |
render: function () { | |
console.log('testing render'); | |
} | |
}); | |
// Return the Main Dashboard View | |
return new Dashboard; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'jquery', | |
'backbone' | |
], | |
function ($, Backbone) { | |
//Docs Metro View | |
var docsMetro = Backbone.View.extend({ | |
el: $('.docs'), | |
events: {}, | |
initialize: function () { | |
console.log('docs Metro'); | |
}, | |
render: function () { | |
console.log('redering docs'); | |
} | |
}); | |
// Return the View | |
return new docsMetro; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<script data-main="main" src="../../scripts/libs/require.js" ></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require.config({ | |
paths: { | |
"jquery": "../../scripts/libs/jquery-1.7.1", | |
"underscore": "../../scripts/libs/underscore", | |
"backbone": "../../scripts/libs/backbone-AMD", | |
"dashBoard": "dashboard", | |
"docsMetro": "docsMetro" | |
} | |
}); | |
require(["dashBoard"], function (dashBoard) { | |
//This function is called when scripts/helper/util.js is loaded. | |
//If util.js calls define(), then this function is not fired until | |
//util's dependencies have loaded, and the util argument will hold | |
//the module value for "helper/util". | |
console.log(dashBoard); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment