I want to run a function when a user edits the content of a div with contenteditable attribute. What\'s the equivalent of an onchange
div
contenteditable
onchange
In Angular 2+
Value
@Component({ ... }) export class ContentEditableComponent { ... type(event) { console.log(event.data) // <-- The pressed key console.log(event.path[0].innerHTML) // <-- The content of the div } }