mizzao:sharejs-codemirror is not working in meteor

96 views Asked by At

I added mizza:sharejs-codemirror in meteor but it is giving error "cannot access sharejs without intialijation"this is the error and the html code is:

<head>
 <title>textcircle</title>
</head>

<body>
 <h1>Welcome to TextCircle</h1>
 {{>editor}}
</body>

<template name="editor">
 {{>sharejsCM docid=docid id="editor"}}
</template>
and this is the js file:

Documents=new Mongo.Collection("documents");
if (Meteor.isClient){
console.log(Meteor);
Template.editor.helpers({
 docid:function() {
  return Documents.findOne()._id;
 }
});
}

if (Meteor.isServer){
 Meteor.startup(function(){
  // code to run on server at startup
  console.log("helo");
  if(Documents.findOne()){
    Documents.insert({title:"my new document"});
}
 })
}

0

There are 0 answers