Просто взглянул на последнюю версию angular, которая запускает команду angular. Angular2 отсутствует, и они выпустили новую веб-страницу http://angular.io.
В них есть 5-минутный проект быстрого запуска, который быстро показывает новый синтаксис и что вы должны использовать для выполнения нового приложения angular.
Я только что сделал все шаги, чтобы заставить его работать, но потребовалось 4,93 секунды для загрузки.
Мне просто интересно, это медленный angular 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>