Despite successfully getting my app.component to work in Angular 2, I am facing issues with a test one. It seems to be stuck at the "Loading..." message in my HTML. Can someone please take a look at my code and point out where I might have gone wrong? I followed the tutorial diligently, but nothing is showing up on the screen.
app.component.ts:
import {Component} from '@angular/core';
import {MyComponent} from './my-component.component';
@Component({
selector: 'my-app',
template: `
<h1>My First Angular 2 App</h1>
<my-component></my-component>`,
directives: [MyComponent]
})
export class AppComponent { }
my-component.ts:
import {Component} from '@angular/core';
@Component ({
selector: 'my-component',
template: `<h2>Hello World</h2>`
})
export class MyComponent {
}
index.html:
<html>
<head>
<title>Angular 2 QuickStart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
</head>
<body>
<my-app>Loading...</my-app>