Last active
October 7, 2015 18:19
-
-
Save cironunes/c28c8c9a447e9868ae75 to your computer and use it in GitHub Desktop.
Simple HTML file to start working with Angular 2 Alpha Preview (Traceur + SystemJS + TypeScript)
This file contains 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>My First Angular 2 app</title> | |
</head> | |
<body> | |
<my-app>Loading...</my-app> | |
<!-- dependencies --> | |
<script src="https://code.angularjs.org/tools/traceur-runtime.js"></script> | |
<script src="https://code.angularjs.org/tools/system.js"></script> | |
<script src="https://code.angularjs.org/tools/typescript.js"></script> | |
<script src="typescript.config.js"></script> | |
<script src="https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js"></script> | |
<!-- /dependencies --> | |
<!-- load app using SystemJS --> | |
<script> | |
System.import('app') | |
.catch(console.error.bind(console)); | |
</script> | |
<!-- /load app using SystemJS--> | |
</body> | |
</html> |
This file contains 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
import {bootstrap} from 'angular2/angular2'; | |
import {App} from './app'; | |
bootstrap(App, []); |
This file contains 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
import {Component, View} from 'angular2/angular2'; | |
@Component({ | |
selector: 'my-app' | |
}) | |
@View({ | |
template: `Hello world!` | |
}) | |
export class App {} |
This file contains 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
System.config({ | |
//use typescript for compilation | |
transpiler: 'typescript', | |
//typescript compiler options | |
typescriptOptions: { | |
emitDecoratorMetadata: true | |
}, | |
//map tells the System loader where to look for things | |
map: { | |
app: "." | |
}, | |
//packages defines our app package | |
packages: { | |
app: { | |
main: './main.ts', | |
defaultExtension: 'ts' | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment