lundi 26 mai 2014

Meteor.js, I cannot display a Template using Meteor Session


Vote count:

0




here is my issue: I have a very basic main layout where you would click an item from a list of items and see the content of that clicked item displayed on a diffrent section of the page. I know there a some example of that that I could copy but since I am learning Meteor, I wanted to complete it myself.


here is the temmplate.js to get the session and return the content:



Template.lelementItem.events({
'click .clic': function(){
Session.set("clickedItem", this.ladescription);
}
});

Template.lelementItem.afficheDescription = function() {
return Session.get("clickedItem");
};


Here is the template.html



<template name="afficheDescription">
{{clickedItem}}
</template>


If I output the content in an alert like this it shows the content but I cannot output the content in the right place using template:



Template.lelementItem.events({
'click .clic': function(){
alert(this.ladescription);
}
});


Thanks for your help in advance..



asked 19 secs ago






Aucun commentaire:

Enregistrer un commentaire