Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Contenteditable div , get form value options angular7

Can I get true/false when I am typing content ? I have to show/hide submit button by using *ngIf option ?

When I am using form we use this form.controls['name'].dirty it should be true or false

My code stackblit

<h5 contenteditable="true"(input)="issueTitle=$event.target.textContent" #titletag>Test </h5>
<button *ngIf="">submit</button>
like image 753
ShibinRagh Avatar asked May 09 '26 22:05

ShibinRagh


1 Answers

You can try like this.

HTML

<h5 contenteditable="true" (keyup)="onKey($event)"> Test </h5>
<button *ngIf="isSubmitShow">submit</button>

TS

isSubmitShow: boolean = true;
onKey(data) {
 this.isSubmitShow = !this.isSubmitShow;
}
like image 136
Yash Rami Avatar answered May 12 '26 13:05

Yash Rami