Angular2 Selector hat keine Elemente mit Bundle und ECM6 gefunden.

Ich habe ein sehr einfaches angle2-Projekt, das für Gulp, Bundle und ECM6 konfiguriert ist. Das Bundle erstellt eine große Datei, die das übersetzte ECM5 von angle plus meine App enthält.

<!DOCTYPE html>
<html>
<head>
    <title>Angular 2 Test</title>
    <script src="bundle.js"></script>
</head>

<body>
<mainapp>

</mainapp>
</body>
</html>

Die eckige App ist wie folgt definiert:

import {Component, View, bootstrap} from 'angular2/core';

export class mainComponent {
    static get annotations() {
        return [
            new Component({
                selector: 'mainapp'
            }),
            new View({
                template: `<div>Hello!</div>`
            })
        ];
    }
}

bootstrap(mainComponent);

Jedoch wenn ich es lade, erhalte ich immer wieder eine Fehlermeldung

"selector 'mainapp' did not match any element"

Antworten auf die Frage(2)

Ihre Antwort auf die Frage