繁体   English   中英

Angular 2应用程序组件未加载

[英]angular 2 app component not loading

我正在做一个简单的angular 2教程,但是在尝试运行我的应用程序时,我只是获得了“加载”。 这是我的index.html文件

 <html>
      <head>
        <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>
        <script>
          System.import('app').catch(function(err){ console.error(err); });
        </script>
      </head>
      <!-- 3. Display the application -->
      <body>
        <my-app>Still Loading...</my-app>
      </body>
    </html>

app.component.ts

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

    @Component({
      selector: 'my-app',
      template: ''
    })
    export class AppComponent {

    }

完整代码在这里: https : //github.com/trinajoy/angularcv

beta.14起, Angular-cli将其系统从SystemJS更改为beta.14 不过,看来您仍在使用SystemJS。

您可以按照以下说明迁移到Webpack。 但是,当您只是在学习教程时,建议您从头开始安装angular-cli

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM