Search code examples
javascriptmeteorsummernote

Using Summernote editor with Meteor


I included the following in my html's body:

{{> editor}}

and the following template

<template name="editor">
    <div id="summernote">Hello Summernote</div>
</template>

In my javascript code I have the following:

Template.editor.onRendered(function()
{
 this.$('.summernote').summernote();
});

I see the following instead of the full blown summernote rich text editor. What am I doing wrong?

enter image description here


Solution

  • Your element has an id of 'summernote', but your selector is looking for an element with a class or 'summernote'

    Change your selector to $('#summernote') like this:

    Template.editor.onRendered(function() {
      this.$('#summernote').summernote();
    }