标签:
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);
标签:
原文地址:http://www.cnblogs.com/lihaozhou/p/4662833.html