我在输入内容时可以得到 true/false 吗? 我必须使用 *ngIf 选项显示/隐藏提交按钮吗?
当我使用表单时,我们使用这个 form.controls['name'].dirty
它应该是 true 或 false
我的代码 stackblit
<h5 contenteditable="true"(input)="issueTitle=$event.target.textContent" #titletag>Test </h5>
<button *ngIf="">submit</button>
最佳答案
你可以这样试试。
HTML
<h5 contenteditable="true" (keyup)="onKey($event)"> Test </h5>
<button *ngIf="isSubmitShow">submit</button>
TS
isSubmitShow: boolean = true;
onKey(data) {
this.isSubmitShow = !this.isSubmitShow;
}
关于html - Contenteditable div,获取表单值选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56270028/