Ajit Goel
Ajit Goel

Reputation: 4388

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

Upvotes: 1

Views: 486

Answers (1)

JeremyK
JeremyK

Reputation: 3240

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();
}

Upvotes: 3

Related Questions