Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/419.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 角度2应用程序组件未加载_Javascript_Angular - Fatal编程技术网

Javascript 角度2应用程序组件未加载

Javascript 角度2应用程序组件未加载,javascript,angular,Javascript,Angular,我正在做一个简单的angular 2教程,但我只是在尝试运行我的应用程序时“加载”。 这是我的index.html文件 <html> <head> <title>Angular CV </title> <base href="/"> <meta charset="UTF-8"> <meta name="viewport" content="w

我正在做一个简单的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>

角CV
System.import('app').catch(函数(err){console.error(err);});
仍在加载。。。
app.component.ts

import { Component } from '@angular/core'; @Component({ selector: 'my-app', template: '' }) export class AppComponent { } 从'@angular/core'导入{Component}; @组成部分({ 选择器:“我的应用程序”, 模板:“” }) 导出类AppComponent{ } 这里有完整的代码:

将他们的系统从SystemJS更改为Webpack,从
beta.14开始。不过,您似乎仍在使用SystemJS


您可以迁移到以下网页包。但是,由于您只是在学习教程,我建议您。

控制台中有错误吗?您应该执行npm安装reflect metadata和npm安装reflect-portfinder。在chrome developer tools中,我收到以下错误shim.min.js:2 Uncaught SyntaxError:Unexpected tokensystemjs.config.js
ok,我刚刚将systemjs.config.js添加到项目中,但应用程序仍然无法正确加载。它只是从我的index.html文件读取加载…我执行了以下npm卸载-g angular cli、npm cache clean、npm install-g angular-cli@latest,然后再次开始,但从我看到的情况来看,我的json文件中有相同的信息,还有angular cli json,我还是说到了同一点,其中我的应用程序仅显示“正在从索引文件加载”。。这里的完整代码:我在尝试一些教程时遇到了同样的问题,但是您仍然在尝试在
index.html
(第17-19行)中导入
SystemJS
(并且还尝试加载SystemJS脚本)。因此,im donig-npm uninstall-g angular cli,npm cache clean,npm安装-g-cli@latest-但仍然没有获得beta 14。。?我做得不对吗?事实上我想我修改了index.html以匹配我正在做的教程。。我想这就是问题所在。。