Skip to content

How to clear editor value #376

Closed Answered by sibiraj-s
imotality asked this question in Q&A
Jan 5, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

#376 (comment)

this.editor.view.dom.innerHTML = ''

Though it works, it is not recommended directly modify the view .

If your form is like this.

class Component {
  form = new FormGroup({
    editor: new FormControl({ value: '', disabled: false }))
  });
}

you can do

this.form.get('editor').reset('')

This should work. Not sure why this.form.reset() is not working though. I can check.

or directly with editor instance

this.editor.setContent('')

Update

From v12.0.1, you can do

this.form.reset()

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@sibiraj-s
Comment options

@sibiraj-s
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by sibiraj-s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants