2

I use formly to render a reactive form with Angular material. now I try to replace a normal textarea field with quill (a text editor for angular)

both formly and quill works fine separately, but the issue is with including a quill editor as a formly field.

what I already tried:

this.fields=[
{
      key: "Quill",
      template: "<b>Quill:</b> <quill-editor></quill-editor>", //only <b>Quill</b> rendered
    },
    {
      key: "Quill2", 
      component: QuillEditorComponent, //hasn't been rendered
    },
  {
      key: "Quill3",
      type: "quill" //a custom type
    }
]

none of the methods above worked!

I don't want to make separate parts of formly, like that:

<formly-form [fields]="articleForm.fields1"></formly-form>
<quill-editor></quill-editor>
<formly-form [fields]="articleForm.fields2"></formly-form>
Sh eldeeb
  • 1,589
  • 3
  • 18
  • 41

1 Answers1

3

Just follow https://formly.dev/guide/custom-formly-field and you'll be able to create ngx-quill type (here is a quick attempt https://stackblitz.com/edit/angular-elwtix.)

a.aitboudad
  • 4,026
  • 23
  • 31