demo: make examples require no build-step. more in README

This commit is contained in:
Andrew
2015-03-21 18:42:36 -06:00
parent 7f5193f009
commit 7385eba03f
18 changed files with 189 additions and 101 deletions

25
example-bootstrap.js Normal file
View File

@ -0,0 +1,25 @@
var exampleReady = function() {
console.error('Implement exampleReady to bootstrap your app.\n' +
'For example: `function exampleReady() { System.import("./main"); }`');
};
(function() {
var loaded = 0;
var scripts = [
'/jspm-config.js',
'https://cdn.rawgit.com/angular/zone.js/v0.4.1/zone.js',
'https://cdn.rawgit.com/angular/zone.js/v0.4.1/long-stack-trace-zone.js',
'https://cdn.rawgit.com/robwormald/50b6b855a6ce21af6967/raw/aa9e1c0eed78defd890ccfcc50c4b4648d4d891d/angular2.js'
];
scripts.forEach(function(src) {
var script = document.createElement('script');
script.onload = function() {
if (++loaded == scripts.length) exampleReady();
};
document.head.appendChild(script);
script.src = src;
});
})();