英文:
Problem while updating angular 8 to angular 16. Error: Cant bind to "something" since it isn't a known property of "something"
问题
我正在将一个旧的 Angular 8 项目升级到 Angular 16。我已经更新了项目。但是现在编译项目时,出现了多个组件错误,例如“无法绑定到 'something',因为它不是 'something' 的已知属性”,其中 'something' 在这里就像某个属性一样,例如:无法绑定到 '
注意:在从 Angular 8 升级到 Angular 15 时曾出现错误。这个错误是在从 Angular 15 升级到 16 时出现的。也许与完全移除的“ngcc”相关。
我已经检查了所有的导入和 app.module 文件。那里没有问题。我猜最有可能是与 Angular 16 中移除的 ngcc 有关。
英文:
I am updating an old angular 8 project to angular 16. I have updated the project. But now compiling the project is giving me multiple error on components "Cant bind to "something" since it isn't a known property of "something",where "something" here is like some property:for example: Cant bind to "<formsGroup>" since it isn't a known property of "div". I am pretty sure that i have done all imports rigth and also everthing is good in the app.module.
Note: There was error while I updated it from angular 8 to angular 15. This error occurs when I updated from angular 15 to 16. Maybe its related to "ngcc" which has been completly removed in angular 16.
I have done and checked all the imports and app.module file. There is nothing wrong there.I guess its most probably related to ngccbeen removed from angular 16.
答案1
得分: 1
我也在从15迁移到16后遇到了相同的问题。
英文:
I am also having same issue after migrating from 15 to 16
答案2
得分: 0
我通过在 NgModule 类中添加 schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]
来修复了这个错误。
英文:
I fixed this error by adding
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]
in the NgModule class
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论