首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >什么是angular ngModule中的entryComponents?

什么是angular ngModule中的entryComponents?
EN

Stack Overflow用户
提问于 2016-09-29 03:35:03
回答 1查看 92K关注 0票数 153

我正在开发一个依赖于angular 2Ionic应用程序( 2.0.0-rc0 )。因此包含了ngModules的新介绍。我在下面添加我的app.module.ts.

代码语言:javascript
运行
复制
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中定义了。那么,有什么必要重复它们呢?如果我在这里没有包含组件,会发生什么?

EN

回答 1

Stack Overflow用户

发布于 2021-12-17 06:16:52

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39756192

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档