javascript - Meteor: Render template inside a template -
I have a list of names on the 'postlist' template. It is the user name of the person who created the post. I have created a href link so that when a user clicks on a name, they are able to see a new template 'viewupost' / view the full post document.
However, I would prefer to provide the 'Viewupstate' template, where I have put {{> produce}} inside the 'Postlist' template. How can I configure LayerMelt because I already have a job for the second part of the app.
Of course, this post document should be clearly changed according to the name of the user name.
See examples of meteorite Todos, depending on whether you click on 'Incorporated' or 'Signin', relevant templates are sung.
So far, everything that is:
postlist.html (showing the list of 'full name' fields in the post documents).
& lt; Template name = "Postlist" & gt; & Lt; Div class = "container" & gt; & Lt; Div class = "call-sm -3" & gt; {{#each post}} & lt; Li & gt; & Lt; A href = "{{pathFor 'viewpost}}" & gt; {{Fullname}} & lt; / A & gt; & Lt; / Li & gt; {{/ Every}} & lt; / Div & gt; & Lt; / Div & gt; {{& Gt; Yield}} & lt; / Template & gt;
router.js
router.map (function () {this.route ('postlist', {path: '/ postlist', template: 'Postlist', waitOn: function (return) Meteor.subscribe ('post');}, data: function (return) {return: post.fund ({}}}}}); this.route (' (Post);}, data: function () {return.fundon (this .params._id);}}};});
Since a content does not overlap among the 'mappost' template and the 'postlist' template, I think it is actually only {{> Watch Pasteupos T}}
in the place of production, and firstly set programmatically. For example, in the postlist template, you can create an existing postal variable that provides data for the current post like:
Template.postlist.helpers ({currentPost: function () {return Post.Fundon (session.get ('moveover'));}});
And set the session when clicking the link in the postlist templates.
Comments
Post a Comment