Summernote Text Editor with FS Collection


In Summernote official website it says by this we can override default imageUpload

var $summernote = $('#summernote');
  onImageUpload: function(files) {
    console.log('image upload:', files);
    // upload image to server and create imgNode...
    $summernote.summernote('insertNode', imgNode);

So in meteor to use that using FS collection, here is a code:

Template.postSubmit.rendered = function(){
            onImageUpload: function(file) {
        FS.Utility.eachFile(event, function(file) {
          Images.insert(file, function (err, fileObj) {
            //Inserted new doc with ID fileObj._id, and kicked off the data upload using HTTP

Now how do i get imgNode, is it the id of the image after upload?? or the image url ??


After the help from a new friend, I’ve got a solution.
It was really a JQuery DOM object

var $dom = $("<img>").attr('src',imagesURL);
$summernote.summernote("insertNode", $dom[0]);