Angular and contenteditable


I’ve searched the web but can’t find a way to work with contenteditable events on Angular 6/7. Angualr seem to have a messy solution with it but said feature doesn’t seem to be carried over to recent versions.

A use case would be is on a content editable onChange event, call a function:

<div contententeditable="true" [change]="onNameChange(">Type your name</div>


private name: string;

onNameChange(name) { = name;

Any ideas on this? Thanks.


You can use the input event, like so:

<div contenteditable (input)="onNameChange($">
   Type your name

Here is a Stackblitz demo

Answered By – user184994

Answer Checked By – Terry (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.