javascript - METEOR: Error invoking Method -
i have following error:
the function "savecalevent" not found on server
but did write it.
why get:
error invoking method 'savecalevent': method not found [404]
even if did write method server-side?
here code:
calevent = new mongo.collection('callevent'); if (meteor.isclient) { template.main.rendered = function(){ var calendar = $('#calendar').fullcalendar({ dayclick: function(date, allday, jsevent, view){ var calendarevent = {}; calendarevent.start = date; calendarevent.end = date; calendarevent.titel = 'new event'; calendarevent.owner = meteor.userid; meteor.call('savecalevent', calendarevent); } }) } } if (meteor.isserver) { meteor.startup(function () { meteor.methods({ 'savecalevent' : function(ce){ calevent.insert(ce); } }); }); }
meteor handles directories differently. list of special folders , scope listed here.
server code stored within client folder not visible server , therefore dead code.
special directories are:
- client
- client/compatibility
- server
- public
- private
- tests
Comments
Post a Comment