connectedMind
connectedMind

Reputation: 439

ngx quill - set default format for editor

I use ngx-quill and try to set the default format of a new editor to be bold

onEditorCreated(quill) {
    quill.format('color', 'red');
    quill.format('align', 'right');
}

these work, however

onEditorCreated(quill) {
    quill.format('bold');
    quill.format('bold', 'bold');
    quill.format('format', 'bold');
    quill.format('inline', 'bold');
    );
  }

these dont.

Docs: https://quilljs.com/docs/api/#formatting

Upvotes: 1

Views: 2967

Answers (1)

connectedMind
connectedMind

Reputation: 439

onEditorCreated(quill) {
    quill.format('bold','true');
    );
  }

pfffff.... Just found out, by getting a hint from here:

https://quilljs.com/docs/api/#updatecontents

.retain(1, { bold: true })

Also thanks https://github.com/KillerCodeMonkey for pushing me in the right direction:

https://github.com/KillerCodeMonkey/ngx-quill/issues/971

Upvotes: 1

Related Questions