ngx-quill: Databinding not working

The databinding feature isn’t working for me. Am I missing something?

My .html <quill-editor [sanitize]="true" [style]="{height: '250px'}" [(ngModel)]="requirement.description"></quill-editor>

My .ts image

My AppModule image

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

@TauanMatos is your quill-editor wrapped in a form tag with ngForm attribute?

Yes.

Then you need a name attribute for each input! But this is an angular restriction πŸ˜ƒ Exactly.

Rookie mistake. Sorry for your time.

what does not work?

check out my demo repos or this https://ngx-quill-dirtiness-demo-ephxwx.stackblitz.io/ there you see the value of the model/formControl after a change πŸ˜‰.

I do not see what the real problem is? Does the initial value is not correctly set, or you changes are not represented on requirements.description.

And which version do you use πŸ˜ƒ

But if i think about it --> you are initialising the editor component before the model is defined. So you load the page --> ngModel is undefined, because you are loading your data afterwards.

So simple show the editor after this.requirement is set πŸ˜ƒ

PS: Screenshots are not very helpful πŸ˜‰.