-
-
Save fxck/6107d6a46ccbc14a50094e36ae41b717 to your computer and use it in GitHub Desktop.
angular2 rc.0
This file contains hidden or 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
/** | |
* PLUNKER VERSION (based on systemjs.config.js in angular.io) | |
* System configuration for Angular 2 samples | |
* Adjust as necessary for your application needs. | |
* Override at the last minute with global.filterSystemConfig (as plunkers do) | |
*/ | |
(function(global) { | |
var ngVer = '@2.0.0-rc.0'; // lock in the angular package version; do not let it float to current! | |
//map tells the System loader where to look for things | |
var map = { | |
'app': 'src', // 'dist', | |
'rxjs': 'https://npmcdn.com/[email protected]', | |
'angular2-in-memory-web-api': 'https://npmcdn.com/angular2-in-memory-web-api' // get latest | |
}; | |
//packages tells the System loader how to load when no filename and/or no extension | |
var packages = { | |
'app': { main: 'app.ts', defaultExtension: 'ts' }, | |
'rxjs': { defaultExtension: 'js' }, | |
'angular2-in-memory-web-api': { defaultExtension: 'js' }, | |
}; | |
var packageNames = [ | |
'@angular/common', | |
'@angular/compiler', | |
'@angular/core', | |
'@angular/http', | |
'@angular/platform-browser', | |
'@angular/platform-browser-dynamic', | |
'@angular/router-deprecated', | |
'@angular/testing', | |
'@angular/upgrade', | |
]; | |
// add map entries for angular packages in the form '@angular/common': 'https://npmcdn.com/@angular/[email protected]' | |
packageNames.forEach(function(pkgName) { | |
map[pkgName] = 'https://npmcdn.com/' + pkgName + ngVer; | |
}); | |
// add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' } | |
packageNames.forEach(function(pkgName) { | |
packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }; | |
}); | |
var config = { | |
transpiler: 'typescript', | |
typescriptOptions: { | |
emitDecoratorMetadata: true | |
}, | |
map: map, | |
packages: packages | |
} | |
// filterSystemConfig - index.html's chance to modify config before we register it. | |
if (global.filterSystemConfig) { global.filterSystemConfig(config); } | |
System.config(config); | |
})(this); | |
/* | |
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 | |
*/ |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>angular2 playground</title> | |
<link rel="stylesheet" href="style.css" /> | |
<script src="https://npmcdn.com/[email protected]"></script> | |
<script src="https://npmcdn.com/[email protected]"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.27/system.js"></script> | |
<script src="https://npmcdn.com/[email protected]/lib/typescript.js"></script> | |
<script src="config.js"></script> | |
<script> | |
System.import('app') | |
.catch(console.error.bind(console)); | |
</script> | |
</head> | |
<body> | |
<my-app> | |
Loading... | |
</my-app> | |
</body> | |
</html> |
This file contains hidden or 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
//our root app component | |
import {Component} from '@angular/core'; | |
import {bootstrap} from '@angular/platform-browser-dynamic'; | |
import {Http, HTTP_PROVIDERS} from '@angular/http'; | |
@Component({ | |
selector: 'my-app', | |
template : `Hello world!` | |
}) | |
export class App { | |
} | |
bootstrap(App, [...HTTP_PROVIDERS]).catch(err => console.error(err)); |
This file contains hidden or 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
* { | |
font-family: Arial, Helvetica, sans-serif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment