1 Angular2 Set up
1 download the angular2.0 demo from github https://github.com/angular/quickstart
2 new index.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="dist/es6-shim.js"></script>
</head>
<body>
<my-app></my-app>
</body>
<script>
System.paths = {
'angular2/*': 'angular2/*.js',
'rtts-assert/*': 'rtts-assert/*.js',
'app': 'app'
};
System.import('app');
</script>
</html>
3 add app.es6
import {Component, Template, bootstrap, For} from 'angular2/angular2';
@Component({
selector: 'my-app'
})
@Template({
inline: '<h1>{{myName}}</h1>'
})
class MyAppComponent {
constructor() {
this.myName = 'Jackey';
}
}
bootstrap(MyAppComponent);
浙公网安备 33010602011771号