2017-06-09 13 views
0

ここにindex.htmlファイルとmain.tsファイルがあります。ブラウザには「読み込み中...」と表示され、作成したコンポーネントは読み込まれません。私を助けてください。ブラウザに角型アプリケーションコンポーネントが読み込まれない

<link rel="stylesheet" 
href="../node_modules/bootstrap/dist/css/bootstrap.min.css"> 
<link rel="stylesheet" href="css/styles.css"> 
<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="../node_modules/bootstrap/dist/js/bootstrap.min.js"> 
<script src="https://code.angularjs.org/tools/typescript.js"> 
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'> 
</script> 
<!-- 2. Configure SystemJS --> 
<script src="systemjs.config.js"></script> 
<script> 
    System.import('app').catch(function(err){ console.error(err); }); 
</script> 
</head> 
<body> 
<blog>Loading...</blog> 
</body> 

main.ts

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 
import { BrowserModule } from '@angular/platform-browser'; 
import { NgModule } from '@angular/core'; 
import { FormsModule } from '@angular/forms'; 
import { AppComponent } from './app.component'; 
import { SignInComponent } from './Login/SignIn/signin.component'; 
import { SignUpComponent } from './Login/SignUp/signup.component'; 
import { routing } from './app.routes'; 

@NgModule({ 
imports: [ BrowserModule, FormsModule, routing ], 
declarations: [ AppComponent, SignUpComponent, SignInComponent], 
bootstrap: [ AppComponent ] 
}) 
class AppModule {} 

platformBrowserDynamic().bootstrapModule(AppModule);` 
+0

angle-cliプロジェクトですか?\ –

答えて

0

headタグ内の最初の行として、あなたのindex.htmlページに<base href="/">を追加してみてください

+0

'{@}/core'から{Component}をインポートします。 @Component({ セレクタ: 'ブログ'、 templateUrl './app.component.html' styleUrls:[」./ app.component.css'] }) エクスポートクラスAppComponent { heading = "Welcome" heading2 = "ようこそ" } –

+0

index.htmlページのをheadタグ内の最初の行として追加してみてください – praveen

0

あなたはすべてのjsを追加する必要が<base href="/">

追加あなたのビルドファイルにCSSファイルがあります。それが角型のプロジェクトなら、あなたは.angular-cli.jsonファイルで設定する必要があります。

"styles": [ 
     "styles.css" 
     ], 
     "scripts": [ 
     "scripts.js" 
], 
関連する問題