我正在开发一个依赖于angular 2
的Ionic
应用程序( 2.0.0-rc0
)。因此包含了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
中定义了。那么,有什么必要重复它们呢?如果我在这里没有包含组件,会发生什么?
发布于 2021-12-17 06:16:52
在Angular 13.1中,不推荐使用EntryComponent。参考文献:https://github.com/angular/angular/blob/master/CHANGELOG.md#1310-2021-12-09
https://stackoverflow.com/questions/39756192
复制相似问题