Created
September 17, 2012 01:16
-
-
Save gabrielhpugliese/3735085 to your computer and use it in GitHub Desktop.
Meteor method is not working
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nomes = new Meteor.Collection("nomes"); | |
Nome = { | |
remove : function(nome) { | |
return Nomes.remove({ | |
nome : nome | |
}); | |
}, | |
get : function(nome) { | |
return Nomes.findOne({ | |
nome : nome | |
}); | |
}, | |
set : function(nome) { | |
return Nomes.insert({ | |
nome : nome | |
}); | |
} | |
}; | |
if (Meteor.is_client) { | |
jQuery(window).unload(function() { | |
Meteor.call('sair', Session.get('nome')); | |
console.log('bla'); | |
}); | |
} | |
if (Meteor.is_server) { | |
Meteor.methods({ | |
sair : function(nome) { | |
return Nome.remove(nome); | |
this.unblock(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Console.log runs and bla appears in the console...anyone knows how to make this work ?