相关疑难解决方法(0)

什么是角度ngModule中的entryComponents?

我正在开发依赖于的Ionicapp(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 {}
Run Code Online (Sandbox Code Playgroud)

是什么entryComponents在这里做?Components已定义于declarations.那么重复它们的必要性是什么?如果我在这里不包含组件会怎么样?

ionic-framework ionic2 angular

115
推荐指数
6
解决办法
6万
查看次数

标签 统计

angular ×1

ionic-framework ×1

ionic2 ×1