확인과 유사한 물건을, 난이 일을 manged했던 한 여기 i'v이 무슨 짓입니다 :
HTML :
<template name="posts">
{{metaTitle}}
{{metaDesc}}
{{metaKeywords}}
{{>home}}
{{#each posts}}
</div>
<a href="{{pathFor 'post'}}">
<div class="small-12 medium-12 large-12 columns">
<div class="post">
<div class="small-12 medium-12 large-12 columns">
<h4 class="left">{{author}}</h4>
<h4 class="right">{{date}}</h4>
</div>
<h2>{{title}}</h2>
<p>{{desc}}</p>
</div>
</div>
</a>
<hr/>
{{/each}}
</template>
라우터 (철 -router) :
this.route('posts', {
path: '/',
waitOn:function(){
NProgress.start();
Meteor.subscribe("Teams");
},
before: function() {
Session.set("adding_group", false);
NProgress.done();
/*
causes problems when phonegap mode
*/
},
fastRender:true,
unload: function() {
Session.set("adding_group", true);
Session.set("group_name", false);
Session.set("group_date", false);
Session.set("group_friends", false);
Session.set("group_location", false);
Session.set("group_rules", false);
Session.set("group_desc", false);
Session.set("group_save", false);
},
yieldTemplates: {
'nav': {to: 'header'}
},
data:{
posts:Posts.find({}),
metaTitle:function(){
var one = Posts.findOne({}); //just for the example
return document.title = one.title; //just for the example
}
}
});
이 동적 경로를 잘못하면 게시물의 문서 제목이 삽입됩니다. 세그먼트 (findOne by ID) 현재 게시물 제목을 반환합니다. 아쉽게도이 간단한 패키지를 패키지로 만들지는 않습니다. 비슷한 패키지를 대기에서 보지 못했습니다. 여러분이 도움이되기를 바랍니다.