Skip to content

Instantly share code, notes, and snippets.

@vladima
Created July 27, 2015 23:03
Show Gist options
  • Save vladima/25d05c091697d3df1dea to your computer and use it in GitHub Desktop.
Save vladima/25d05c091697d3df1dea to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Test</title>
<script language="javascript" src="system.js"></script>
<script>
System.config({
paths: {
'*': '*.js'
}
});
System.import("m1").then(function (m) {
alert(m.t)
})
</script>
</head>
<body>
</body>
</html>
// m1.js
System.register(["m2", "m2"], function(exports_1) {
var m2_1, m2_2;
var t;
return {
setters:[
function (_m2_1) {
m2_1 = _m2_1;
},
function (_m2_2) {
m2_2 = _m2_2;
}],
execute: function() {
exports_1("t", t = m2_1.x + m2_2.y);
}
}
});
// m1.ts
import {x} from "m2";
import {y} from "m2";
export let t = x + y;
// m2.js
System.register([], function(exports_1) {
var x, y;
return {
setters:[],
execute: function() {
exports_1("x", x = 1);
exports_1("y", y = 2);
}
}
});
// m2.ts
export let x = 1;
export var y = 2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment