0

私は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({
4

1 に答える 1