Angular 16 中的入口组件替换

Mus*_*afa 5 typescript angular angular16

我已将我的项目更新到 Angular 16。在 中app.module.ts,我有一组名为 的组件entryComponents。但是,entryComponentsAngular 16 中不再提供这些组件。我应该在哪里将这些组件添加到我的项目中:

entryComponents:[
    PayResultDialogComponent,
    MessageBoxComponent
  ],
Run Code Online (Sandbox Code Playgroud)

IDK*_*eal 5

从 Angular 版本 10 开始并引用Angular 更新

在您的应用程序项目中,您可以删除entryComponentsNgModule 以及ANALYZE_FOR_ENTRY_COMPONENTS. Ivy 编译器和运行时不再需要它们。如果构建将由 View Engine 应用程序使用的库,您可能需要保留这些内容。

因此从理论上讲,您可以简单地删除它们,因为不再需要它们。

entryComponent如果您仍然遇到错误,那么您可以尝试在使用它们的declarations组件或独立组件的数组中添加相应的错误。@Ngmodule