editor.displaynode() vs editor.template() when modifying HTML

editor.displaynode() vs editor.template() when modifying HTML

washuit-iammwashuit-iamm Posts: 133Questions: 55Answers: 2

Which is preferred?

editor.on('open', function(){
    const editor = this;
    const displayNode$ = $(editor.displayNode());
    displayNode
        .find('#formErrors')
        .empty();
});

VS

editor.on('open', function () {
    const editor = this;
    editor
        .template()
        .find('#formErrors')
        .empty()
});

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Probably displayNode(). That would allow it to work even if a template isn't specified.

    Allan

Sign In or Register to comment.