gpt4 book ai didi

javascript - Angular 错误 : If ngModel is used within a form tag, 必须设置名称属性或

转载 作者:行者123 更新时间:2023-11-30 08:23:59 29 4
gpt4 key购买 nike

<分区>

关于该错误有许多类似的问题和答案:如果在表单标记中使用 ngModel,则必须设置 name 属性或者必须在 ngModelOptions 中将表单控件定义为“standalone”。 解决方案是按照消息中的描述定义 name 属性。但这对我不起作用。我的 app.component.html 中有下一个标记:

<form id="form1" name="form1" #form="ngForm">
<div class="form-group">
<input id="input1" name="input1" [(ngModel)]="metaScript" />
...

而且我在 app.component.html 第 3 行中仍然有错误:如果在表单标记中使用 ngModel,则必须设置 name 属性或...

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com