user6086008 user6086008 - 1 year ago 191
Javascript Question

angular 2 app component not loading

I am doing a simple angular 2 tutorial, but i just get 'loading' when trying to run my app.
this is my index.html file

<title>Angular CV </title>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- 1. Load libraries -->
<!-- Polyfill 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>
<!-- 2. Configure SystemJS -->
<script src="systemjs.config.js"></script>
System.import('app').catch(function(err){ console.error(err); });
<!-- 3. Display the application -->
<my-app>Still Loading...</my-app>


import { Component } from '@angular/core';

selector: 'my-app',
template: ''
export class AppComponent {


full code here:

Answer Source

Angular-cli changed their system from SystemJS to Webpack since beta.14. It seems you're still using SystemJS, though.

You can migrate to Webpack following these instructions. However, as you're just following a tutorial, I'd recommend to install angular-cli from scratch.

There's also an article on StackOverflow showing how to do it.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download