2016-09-16 14 views
0

私はRC4からRC7にアプリケーションをアップグレードしようとしています。私はsrc/appフォルダにapp.module.tsを作成しました。私はこのエラーが出るのはなぜRC4からRC7への角2のアップグレード

WARNING in ./src/main.ts 
9:41 export 'AppModule' was not found in './app/' 

ERROR in [default] c:\xampp\htdocs\newPROJECT\src\main.ts:6:9 
Module '"c:/xampp/htdocs/newPROJECT/src/app/index"' has no exported member 'AppModule'. 

:次のエラーが返されます

import { AppModule } from './app/'; 

:私のsrcフォルダ内の

は私のmain.ts以下の行を持っていますか?

//index.ts

を:私は AppModuleをエクスポートするあなたは appフォルダに index.tsを作成する必要があります。..働く他のプロジェクトと同じ

私app.module.ts

import { BrowserModule } from '@angular/platform-browser'; 
import { NgModule, ApplicationRef} from '@angular/core'; 
import { CommonModule } from '@angular/common'; 
import { HttpModule,RequestOptions } from '@angular/http'; 
import { FormsModule} from '@angular/forms'; 
import { routing, 
     appRoutingProviders } from './app.routing'; 

//Routes 
import { ComboFinderComponent } from './combo-finder/combo-finder.component'; 

@NgModule({ 
    declarations: [ 
    AppComponent, 
    ComboFinderComponent 
    ], 
    imports: [ 
    BrowserModule, 
    CommonModule, 
    FormsModule, 
    HttpModule, 
    routing, 
    ], 
    providers: [ 
    {provide:RequestOptions, useClass: CustomRequestOptions } 
    ], 
    entryComponents: [AppComponent], 
    bootstrap: [AppComponent] 
}) 
export class AppModule { 

} 

答えて

1

をしました
export * from './app.module'; 

または、次のように、あなたのmain.tsAppModuleをインポートすることができます。

import { AppModule } from './app/app.module'; 
+0

これだけです。ありがとう! – TheUnreal

関連する問題