代码如下:
for (const key of Object.keys(this.form.controls)) {
console.log(key);
if (this.form.get(key).value === 'null') {
this.form.get(key).setValue(null);
}
}
代码如下:
for (const key of Object.keys(this.form.controls)) {
console.log(key);
if (this.form.get(key).value === 'null') {
this.form.get(key).setValue(null);
}
}
本文标题:angular中获取对象的属性名称
本文链接:https://www.haomeiwen.com/subject/okcuvctx.html
网友评论