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?
Replace the code kinda
*ngFor="let movement of allowedMovements" [(value)]="movement"
to
*ngFor="let movement of allowedMovements; let i = index" [(value)]="allowedMovements[i]"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With