最佳答案
我工作的 Ionic应用程序(2.0.0-rc0) ,这取决于 angular 2。因此,ngModules的新介绍被包括在内。我在下面添加我的 app.module.ts.。
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { MyApp } from './app.component';
import { Users } from '../pages/users/users';
@NgModule({
declarations: [
MyApp,
Users
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
Users
]
})
export class AppModule {}
entryComponents在这里做什么?Components已经在 declarations中定义。那么有什么必要重复它们呢?如果这里没有包含组件会发生什么?