Skip to content

Commit

Permalink
upgrade es-module-loader, angular test, ensure System is written still
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 24, 2017
1 parent e8ee8cf commit 8afdc93
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-es2015-modules-systemjs": "^6.19.0",
"bluebird": "^3.4.6",
"es-module-loader": "ModuleLoader/es-module-loader#next",
"es-module-loader": "^2.0.0",
"mocha": "^3.1.2",
"plugin-typescript": "^5.2.7",
"rollup": "^0.41.1",
Expand Down
19 changes: 2 additions & 17 deletions src/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,8 @@ SystemJSLoader.prototype.version = VERSION;
var System = new SystemJSLoader();

// only set the global System on the global in browsers
if (isBrowser || isWorker) {
global.SystemJS = System;

// dont override an existing System global
if (!global.System) {
global.System = System;
}
// rather just extend or set a System.register on the existing System global
else {
var register = global.System.register;
global.System.register = function () {
if (register)
register.apply(this, arguments);
System.register.apply(this, arguments);
};
}
}
if (isBrowser || isWorker)
global.SystemJS = global.System = System;

if (typeof module !== 'undefined' && module.exports)
module.exports = System;
37 changes: 37 additions & 0 deletions test/angular.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello Angular</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {color:#369;font-family: Arial,Helvetica,sans-serif;}
</style>

<!-- Polyfills for older browsers -->
<script src="https://unpkg.com/core-js/client/shim.min.js"></script>

<script src="https://unpkg.com/zone.js@0.7.4?main=browser"></script>
<script src="https://unpkg.com/reflect-metadata@0.1.8"></script>
<script src="../dist/system.src.js"></script>

<script> window.autoBootstrap = true; </script>

<script src="https://cdn.rawgit.com/angular/angular.io/b3c65a9/public/docs/_examples/_boilerplate/systemjs.config.web.js"></script>
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
</head>

<body>
<my-app>Loading AppComponent content here ...</my-app>
</body>

</html>


<!--
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
-->
14 changes: 14 additions & 0 deletions test/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Component } from '@angular/core';

@Component({
selector: 'my-app',
template: `<h1>Hello {{name}}</h1>`
})
export class AppComponent { name = 'Angular'; }


/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/

0 comments on commit 8afdc93

Please sign in to comment.