码迷,mamicode.com
首页 > 其他好文 > 详细

1 Set up

时间:2015-07-20 22:55:47      阅读:100      评论:0      收藏:0      [点我收藏+]

标签:

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);

  

1 Set up

标签:

原文地址:http://www.cnblogs.com/lihaozhou/p/4662833.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!