<!DOCTYPE html>
<html>
<head>
<title>angular2 playground</title>
<link rel="stylesheet" href="style.css" />
<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="config.js"></script>
<script src="https://code.angularjs.org/2.0.0-alpha.42/angular2.min.js"></script>
<script src="https://code.angularjs.org/2.0.0-alpha.42/http.min.js"></script>
<script>
System.import('app')
.catch(console.error.bind(console));
</script>
</head>
<body>
<my-app>
loading...
</my-app>
</body>
</html>
/* Styles go here */
### Angular2 Starter Plunker - Typescript - Alpha .42
A simple plunker demonstrating Angular2 usage:
- Uses SystemJS + TypeScript to compile on the fly
- Includes binding, directives, and DI usage.
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: "./src"
},
//packages defines our app package
packages: {
app: {
main: './app.ts',
defaultExtension: 'ts'
}
}
});
import {Component, View, bootstrap} from 'angular2/angular2'
@Component({
selector: 'my-app'
})
@View({
template: `
<div>
<h2>Hello Angular2!</h2>
<button (click)="sayMyName()">Click</button>
</div>
`
})
export class MyApp {
constructor() {
}
sayMyName() {
alert('My name is Nisar')
}
}
bootstrap(MyApp);