ngx quill - установить формат по умолчанию для редактора

Я использую ngx-quill и пытаюсь установить для нового редактора формат по умолчанию: полужирный

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

эти работы, однако

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

эти не делают.

Документы: https://quilljs.com/docs/api/#formatting


person connectedMind    schedule 17.07.2020    source источник


Ответы (1)


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

пффффф .... Только что выяснил, получив подсказку отсюда:

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

.retain (1, {жирный: правда})

Также благодарим https://github.com/KillerCodeMonkey за то, что подтолкнули меня в правильном направлении:

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

person connectedMind    schedule 17.07.2020