【问题标题】:Using old Angular module in new project and vice-versa在新项目中使用旧的 Angular 模块,反之亦然
【发布时间】:2021-03-03 15:27:24
【问题描述】:

我使用较旧的 Angular 版本为 Angular 项目构建了一些 feature module。如果我将这些模块导入到一个新的 Angular 项目中会有什么问题吗?

反之亦然,如果我想构建一个新的功能模块,使用新版本的 Angular 并将这个模块导入到旧的 Angular 项目中,会有什么问题吗?

我查看了之前的一些问题,发现存在冲突/没有给出具体答案

How to get multiple versions on angular depending modules

Angular Libraries Monorepo: Is it possible to use different versions for every library?

Correct way to package an Angular library to support Angular 8, 9 and 10

【问题讨论】:

    标签: angular


    【解决方案1】:

    在 Angular 中,node_modules 文件夹中只能有一组 @angular 代码。这意味着您的应用程序只能安装一个版本的 Angular。

    一种解决方案是通过以下链接将新功能构建为组件库:Building an Angular 4 Component Library with the Angular CLI and ng-packagr

    但最好的解决方案是将所有代码移至更高版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-28
      • 2013-10-01
      • 2012-11-19
      • 1970-01-01
      • 2017-11-17
      • 1970-01-01
      • 2020-10-25
      • 2011-08-18
      相关资源
      最近更新 更多