I am learning meteor and following this link.
When I use Session.set
it gives me error Session is not defined
in console
My code of main.js file within client folder is following
PlayersList = new Meteor.Collection('players');
if(Meteor.isClient) {
Template.leaderboard.events({
'click .playerName ': function(){
var playerId = this._id;
Session.set('selectedPlayer', playerId);
}
});
}
I don't know what I am doing wrong
I already read this post.
My file is inside client folder and code also inside isClient
condition.
Still it giving me error.
The session package isn't installed by default anymore. You just need to run:
meteor add session
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With