刚刚查看了 Angular 团队发布的最后一个 Angular 版本。Angular2 出来了,他们已经发布了他们的新网页https://angular.io。
在那里,他们有一个 5 分钟的快速入门项目,可以快速显示新语法以及您必须使用什么来执行新的 Angular 应用程序。
我刚刚完成了所有步骤以使其正常工作,但加载需要 4.93 秒。
我只是想知道,角度 2 有那么慢吗?或者也许我错过了一些步骤。
这是我的代码
// app.es6
import { Component, Template, bootstrap } from "angular2/angular2";
// Annotation section
@Component({
selector: "my-app"
})
@Template({
inline: "<h1>Hello {{ name }}</h1>"
})
// Component controller
class MyAppComponent {
constructor() {
this.name = "Alex!";
}
}
bootstrap(MyAppComponent);
和index.html
<!-- index.html -->
<html>
<head>
<title>Angular 2 Quickstart</title>
<script src="dist/es6-shim.js"></script>
</head>
<body>
<!-- The app component created in app.js -->
<my-app></my-app>
<script>
// Rewrite the paths to load the files
System.paths = {
'angular2/*':'angular2/*.js', // Angular
'rtts_assert/*': 'rtts_assert/*.js', //Runtime assertions
'app': 'app.js' // The my-app component
};
// Kick off the application
System.import('app');
</script>
</body>
</html>