Permalink
Browse files

Extended demo

  • Loading branch information...
1 parent 3c266ac commit d58d3fae4ff6b8c5563015687f4d18117218033a @cramforce cramforce committed Sep 30, 2012
View
@@ -49,7 +49,7 @@ Make sure you have the java binary in your path :)
Example:
- node module-compiler/bin.js --module_path=./test/fixtures/sample-module --entry_module=app --output_path=./build/
+ node module-compiler/bin.js --module_path=./test/fixtures/sample-module --entry_module=app --output_path=../build/
## Fine print
View
@@ -5,6 +5,8 @@
file in your web browser</p>
<pre id="log"></pre>
+<button onclick="loadMoreCode()">Load more code</button>
+
<script src="../third-party/LABjs/LAB.src.js"></script>
<script src="../module-client.js"></script>
@@ -28,4 +30,10 @@
document.getElementById('log').textContent += msg + '\n';
}
+function loadMoreCode() {
+ loadModule('sub_app', function(app) {
+ app.testLoad()
+ });
+}
+
</script>
View
@@ -26,7 +26,7 @@ var config = opt.configSync({
function usage() {
console.log('Example: node module-compiler/bin.js --module_path=' +
- './test/fixtures/sample-module --entry_module=app --output_path=./build/');
+ './test/fixtures/sample-module --entry_module=app --output_path=../build/');
opt.usage();
process.exit(0);
}
@@ -1 +1 @@
-var module$module$baz$foo={foo:function(){return"test"}};
+var module$module$baz$foo={foo:function(){return"test"},log:function(a){window.log(a)}};

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1 +1 @@
-var module$sub_app={subApp:function(){return"sub"},testLoad:function(){loadModule("module/baz/foo",function(){})}};
+var module$sub_app={subApp:function(){return"sub"},testLoad:function(){loadModule("module/baz/foo",function(a){a.log("Logged via foo")})}};

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,3 +1,7 @@
exports.foo = function() {
return 'test';
};
+
+exports.log = function(msg) {
+ window.log(msg);
+};
@@ -4,6 +4,6 @@ exports.subApp = function() {
exports.testLoad = function() {
loadModule('module/baz/foo', function(foo) {
-
- })
+ foo.log('Logged via foo');
+ });
};

0 comments on commit d58d3fa

Please sign in to comment.