您的位置:首页 > Web前端 > AngularJS

1 Angular2 Set up

2015-07-20 21:59 483 查看
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);


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: