When I download my typescript angular 2 test application, it does not load as expected.
I always see "Loading ..." from my-app in the html index file.
I also don't get errors in the bowser console: /
Does anyone see a mistake?
INDEX
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>test</title> <script src="~/lib/es6-shim.js"></script> <script src="~/lib/es6-promise.js"></script> <script src="~/lib/system-polyfills.js"></script> <script src="~/lib/angular2-polyfills.js"></script> <script src="~/lib/system.js"></script> <script src="~/lib/Rx.js"></script> <script src="~/lib/angular2.js"></script> <script src="~/lib/http.dev.js"></script> <script src="~/lib/router.dev.js"></script> <script> System.config({ packages: { app: { format: 'register', defaultExtension: 'js' } } }); System.import('app/main') .then(null, console.error.bind(console)); </script> </head> <body> <my-app>Loading...</my-app> </body> </html>
main.ts
///<reference path="../node_modules/angular2/typings/browser.d.ts"/> import {provide} from 'angular2/core'; import {bootstrap, ELEMENT_PROBE_PROVIDERS} from 'angular2/platform/browser'; import {HTTP_PROVIDERS} from 'angular2/http'; import {AppComponent} from './app.component' bootstrap(AppComponent).catch(err => console.error(err));
app.component.ts
import {Component} from 'angular2/core'; @Component({ selector: 'my-app', // providers: [...FORM_PROVIDERS], // directives: [...ROUTER_DIRECTIVES, RouterActive], pipes: [], styles: [], template: ` <h1>Hello {{ name }}</h1> ` }) export class AppComponent { angularclassLogo = 'assets/img/angularclass-avatar.png'; name = 'Angular 2 Webpack Starter'; url = 'https://twitter.com/AngularClass'; constructor() { } }
source share