angular11 报错 ERROR Error: If ngModel is used within a form tag, either the name attribute must be set or the form
angular 报错 ERROR Error: If ngModel is used within a form tag, either the name attribute must be set or the form control must be defined as 'standalone' in ngModelOptions. Example 1: <input [(ngModel)]="person.firstName" name="first"> Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">
创建表单的时候,系统默认会创建一个”FormGroup"的对象。用带有“ngModel"的”“标签时
遇到这个问题 通常是因为 input 标签没有 name 添加上name=”xxxName”就可以哦了~~
例如:ZORRO中的nz-select
<form nz-form nzLayout="vertical" #f="ngForm" se-container>
<se label="AAA">
<nz-select [(ngModel)]="form.AAA" nzMode="multiple">
<nz-option [nzValue]="data" [nzLabel]="data" *ngFor="let data of AAADatas"></nz-option>
</nz-select>
</se>
</form>
改为
<form nz-form nzLayout="vertical" #f="ngForm" se-container>
<se label="aaa">
<nz-select [(ngModel)]="form.aaa" nzMode="multiple" name="aaa">
<nz-option [nzValue]="data" [nzLabel]="data" *ngFor="let data of aaaDatas"></nz-option>
</nz-select>
</se>
</form>
angular11 报错 ERROR Error: If ngModel is used within a form tag, either the name attribute must be set or the form的更多相关文章
- Angular: If ngModel is used within a form tag, either the name attribute must be set or the form control must be defined as ‘standalone’ in ngModelOptions.
在Angular中,动态生成的Html控件,如果没有name属性并且在ts中要操作Model的内容.就会引发如题的错误. 解决方案两个: 加上name的属性 设置ngModelOptions [n ...
- JS function document.onclick(){}报错Syntax error on token "function", delete this token
JS function document.onclick(){}报错Syntax error on token "function", delete this token func ...
- 一个参数大小写引发的uploadify报错 "Syntax error, unrecognized expression: #"
上传控件uploadify 报错"Syntax error, unrecognized expression: #" 版本为 uploadify3.2 报错原因:参数ID[hi ...
- yum报错:Error: xz compression not available
测试服务器(centos6.5)经过一段时间的折腾,有一天在上面进行yum操作时突然出现下面的报错: Error: xz compression not available 最后经过一番排查,发现原因 ...
- yum报错: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
在Centos 5.x或6.x上安装RHEL EPEL Repo repository,资源库,源的意思.RHEL EPEL(Extra Packages for Enterprise Linux) ...
- redis报错Windows error 0x70(a large memory)
redis报错Windows error 0x70 redis 嫌弃你内存不够了,就给你不开第二个实例. The Windows version of Redis allocates a large ...
- ASSERT报错:error C2664: “AfxAssertFailedLine”: 不能将参数 1 从“TCHAR []”转换为“LPCSTR”
转载请注明来源:崨雁嫀筝 http://www.cnblogs.com/xuesongshu 这个错误是我在把tinyxml修改为宽字符(Unicode)版本时候遇到的问题,我首先按关键字把所有有ch ...
- 启动安卓模拟器报错 emulator: ERROR: x86_64 emulation currently requires hardware acceleration! CPU acceleration status:HAXM must be updated(version 1.1.1<6.0.1) 解决办法
启动安卓模拟器报错 emulator: ERROR: x86_64 emulation currently requires hardware acceleration! CPU accelerat ...
- sql查询语句报错处理——ERROR: failed to find conversion function from unknown to text
今天遇到写存储过程遇到的一个小问题,在查询语句中使用到了自定义的数当做列的值,然后想给这一列起一个别名 ,就直接在后面用了 as 别名.执行存储过程,存储过程报错,ERROR: failed to f ...
- SOAPtest报错:error occurred during initialization of vm解决方法
参考:http://forums.parasoft.com/index.php?act=ST&f=36&t=614 安装SOAPtest报错:error occurred during ...
随机推荐
- 【MySQL】04_约束
约束 概述 为了保证数据的完整性,SQL规范以约束的方式对表数据进行额外的条件限制.从以下四个方面考虑: 实体完整性(Entity Integrity) :例如,同一个表中,不能存在两条完全相同无法区 ...
- Codeforces Round #826 (Div. 3) A-E
比赛链接 A 题解 知识点:模拟. 时间复杂度 \(O(n)\) 空间复杂度 \(O(n)\) 代码 #include <bits/stdc++.h> #define ll long lo ...
- QML 怎么调用 C++ 中的内容?
以下内容为本人的学习笔记,如需要转载,请声明原文链接微信公众号「englyf」https://mp.weixin.qq.com/s/z_JlmNe6cYldNf11Oad_JQ 先说明一下测试环境 编 ...
- MYSQL数据库的导出和导入
一.连接服务器查看数据库 使用连接工具(xshell6等)连接到数据库所在服务器,执行命令查询需要导出的数据库 1.输入数据库管理员账号密码进入控制台:mysql -uroot -p123456 ...
- 2022春每日一题:Day 29
题目:Mishka and Interesting sum 这题稍微分析就能发现实际这个题就是求区间异或和异或上区间不同数的异或和,因此直接转化为HH的项链. 代码: #include <cst ...
- Java开发环境安装与配置(干货详细教程)
Java开发环境安装与配置(干货详细教程) 对于文章中出现的任何错误请大家批评指出,会及时做出修改! 安装JDK JDK是 Java 语言的软件开发工具包要学习 链接Java中国官网https:/ ...
- 基于python的数学建模---机场航线设计
数据集 拿走: 链接:https://pan.baidu.com/s/1zH5xhpEmx2_u5qO9W4gCkw 提取码:2wl5 数据集来自航空业,有一些关于航线的基本信息.有某段旅程的起始点和 ...
- nydusd 源码理解(一)
" 尝试通过 nydus[1] 源码理解工作流程.可能由于代码变动导致和本文记录的内容有出入. 1. 环境准备 git clone https://github.com/dragonflyo ...
- Redux 的困扰与如何技术选型
文章的名字我想了很久,备选项有"我再不推荐 Redux","Redux 为什么令我头疼","Redux 进化启示录"等等.通过这一系列名字我 ...
- dp状态设计
迎接仪式 题目描述 LHX 教主要来 X 市指导 OI 学习工作了.为了迎接教主,在一条道路旁,一群"Orz 教主 er"穿着文化衫站在道路两旁迎接教主,每件文化衫上都印着大字.一 ...