Created
April 7, 2011 21:01
-
-
Save schamane/908709 to your computer and use it in GitHub Desktop.
start it with : node main.js
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
var config = { | |
loadDir: { | |
base: __dirname + '/', | |
dirs: [ 'modules/' ] | |
} | |
}; | |
require('yui3').YUI( config ).use('loader', 'dump', function(Y) { | |
Y.log("app starts", 'info'); | |
Y.use('module1', function(Y){ | |
Y.log("callback", 'info'); | |
Y.log( Y.dump(new Y.Module1()), 'info'); | |
}); | |
}); |
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
/* this file goes into modules folder at same location as main.js */ | |
YUI.add('module1', function(Y) { | |
var Module1 = function() { | |
Y.log("Module created !", 'info', Module1.PACKAGE); | |
}; | |
Module1.NAME = "Module1"; | |
Module1.PACKAGE = "Module1"; | |
Y.namespace().Module1 = Module1; | |
Y.log("module load finished", 'info', Module1.PACKAGE); | |
console.log("inner model1"); | |
}, '0.1', { requires: [ 'oop' ] }); | |
console.log("loading module1 " + new Date()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment