I am trying out angular2 in the ES5 way with this code:
<html>
<head>
<script src="https://code.angularjs.org/2.0.0-alpha.31/angular2.sfx.dev.js"></script>
<script>
function AppComponent() {}
AppComponent.annotations = [
new angular.Component({
selector: 'my-app'
}),
new angular.View({
template: '<h1>My first Angular 2 App</h1>'
})
];
document.addEventListener('DOMContentLoaded', function() {
angular.bootstrap(AppComponent);
});
</script>
</head>
<body>
<my-app></my-app>
</body>
</html>
In chrome I am getting the nasty error:
Uncaught ReferenceError: angular is not defined
Specifically with the line that says:
new angular.Component({