我开始看一下angular2,但是用这个简单的代码
<html>
<head>
<script src="https://code.angularjs.org/2.0.0-alpha.19/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>
我有以下错误:
SyntaxError: in strict mode code, functions may be declared only at top level or immediately within another function function onGlobalPostMessage(event) {
ReferenceError: angular is not defined new angular.Component({