将angular 8应用迁移到9的奇怪问题 [英] strange problem migrating angular 8 app to 9
本文介绍了将angular 8应用迁移到9的奇怪问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将应用程序从8号角迁移到9号角.如果我尝试为部署而构建,则会收到此错误消息
I'm migrating an application from angular 8 to 9. If I try to build for deploy I obtain this error message
ERROR : Cannot assign value "$event" to template variable "value". Template variables are read-only.
at _AstToIrVisitor.visitPropertyWrite (...\node_modules\@angular\compiler\bundles\compiler.umd.js:8617:31)
at PropertyWrite.visit (...\node_modules\@angular\compiler\bundles\compiler.umd.js:7459:28)
at convertActionBinding (...\node_modules\@angular\compiler\bundles\compiler.umd.js:8224:49)
at prepareEventListenerParameters (...\node_modules\@angular\compiler\bundles\compiler.umd.js:16861:27)
at Object.params (...\node_modules\@angular\compiler\bundles\compiler.umd.js:17952:24)
at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17725:94
at Array.map (<anonymous>)
at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17725:60
at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17014:87
at Array.map (<anonymous>)
at TemplateDefinitionBuilder.buildTemplateFunction (...\node_modules\@angular\compiler\bundles\compiler.umd.js:17014:60)
at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17558:60
at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:16992:81
at Array.forEach (<anonymous>)
at TemplateDefinitionBuilder.buildTemplateFunction (...\node_modules\@angular\compiler\bundles\compiler.umd.js:16992:37)
at Object.compileComponentFromMetadata (...\node_modules\@angular\compiler\bundles\compiler.umd.js:18643:58)
我怎么能发现问题发生了?
How can I find the problem happens?
推荐答案
替换代码种类
*ngFor="let movement of allowedMovements" [(value)]="movement"
到
*ngFor="let movement of allowedMovements; let i = index" [(value)]="allowedMovements[i]"
这篇关于将angular 8应用迁移到9的奇怪问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文