の違いは何ですか:私はapp.module.tsでこれを持って宣言とentryComponents
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { HttpModule, Http } from '@angular/http';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { EliteApi } from '../shared/shared';
import { MyApp } from './app.component';
import { MyTeams, Tournaments, TeamDetails, Teams, TeamHome, Standings } from '../pages/pages';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
@NgModule({
declarations: [
MyApp,
MyTeams,
TeamDetails,
Tournaments,
Teams,
TeamHome,
Standings
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
HttpModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
MyTeams,
TeamDetails,
Tournaments,
Teams,
TeamHome,
Standings
],
providers: [
HttpModule,
StatusBar,
SplashScreen,
{ provide: ErrorHandler, useClass: IonicErrorHandler },
EliteApi
]
})
export class AppModule { }
は、現時点では私のdeclarations
とentryComponents
両方がまったく同じです。彼らは私のアプリケーション用に構築したすべてのページ/コンポーネントを含んでいます。いずれかのプロパティからエントリを削除すると、angular2でエラーが発生します。
私の質問は、いつも同じであれば、これらのプロパティの必要性は何ですか?私は間違いなくここにいくつかの点を欠いていると思う。 entryComponentsとdeclaractionsはいつ異なるでしょうか?
[OK]を、私は見てます –