2016-06-25 6 views
0

GitHub enter link description hereからAngular2 Quick Startをダウンロードしました。すべての設定ファイルをconfigディレクトリに移動して、プロジェクトを整理しておきました。したがって、 "404 GET /app/app.component.js"という問題が発生しました。Angular2 - 404 GET /app/app.component.js

だから、私のプロジェクトは次のようになります。

  • PROJECT_NAME
  • のApp
    • app.component.ts
    • main.ts
  • 設定
      を210
    • は、すべての構成ファイル(TSconfigの、タイピング、パッケージ、等。)

出力

16.06.25 19時08分55秒の#サンプル304 GET /main.jsを含み 16.06.25 19:08:55 304 GET /node_modules/@angular/platform-b​​rowser-dynamic//bundles/platform-b​​rowser-dynamic.umd.js 16.06.25 19:08:55 404 GET/app/app.component.js 16.06.25 19:08:55 304 GET /node_modules/@angular/common//bundles/common.umd.js 1 16.06.25 19:08:55 304 GET /node_modules/@angular/compiler//bundles/compiler.umd.js 16.06.25 19:08:55 304 GET/node_modules/@ angular/core // bundle/

#1 Main.ts

import {bootstrap} from '@angular/platform-browser-dynamic'; 
 
import {AppComponent} from "app.component"; 
 

 
bootstrap(AppComponent);
/node_modules/@angular/platform-b​​rowser//bundles/platform-b​​rowser.umd.js core.umd.js 16.06.25 19時08分55秒304 GETを

#1 app.component.ts

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

 
@Component({ 
 
    selector: 'my-app', 
 
    template: '<h1>My First Angular 2 App</h1>' 
 
}) 
 
export class AppComponent { }

+0

同じものに対してプランナーを作成できますか? –

答えて

0

これは、 "app.component" から インポート{AppComponent}を変更することによって解決することができます。


移入 "./app.component" から{AppComponent}。