【发布时间】:2019-01-02 22:41:02
【问题描述】:
我有这个 HTML 模板:
<input type="text"
ngModel
#myValue="ngModel"
name="{{ fieldName }}"
id="{{ fieldName }}"
value="{{ myVal }}"
class="form-control"
(change)="checkDirty(myValue)">
如何检查 my.component.ts 文件中的该字段是否脏?
现在我的 my.component.ts 文件中只有这个基本代码:
export class UriFieldComponent implements OnInit {
constructor() { }
ngOnInit() { }
checkDirty(value) {
// in here I need to check is dirty or not
}
}
【问题讨论】:
标签: angular angular7 dirty-checking