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

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

washuit-iammwashuit-iamm Posts: 126Questions: 54Answers: 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: 62,006Questions: 1Answers: 10,165 Site admin

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

    Allan

Sign In or Register to comment.