My app.component.ts has below code
public sendData(data: any) {
console.log(data);
}
app.component.html has below code
<div type="text" contenteditable="true" (ngModelChange)="sendData($event)" [innerHTML]="childSampleData" (input)="childSampleData=$event.target.innerHTML"
style="background-color : pink">
sendData($event) is not working with tag. ngModelChange() is not working with div tag. Whereas, if I use below code (with input tag, also it works with textArea) sendData($event) is working fine.
<input type="text" class="form-control" value="{{ childSampleData }}" [(ngModel)]='childSampleData' (ngModelChange)="sendData($event)">
Can anyone suggest how to use ngModelChange() with div or there any other solution for achieving the same?