0
私は自分のプロジェクトに検索機能を持っています。自動公開を使わずに結果を公開する必要があります。流星:自動公開を使わないで検索(フィルタ)を作成する
HTML
<template name="search">
<form id="searchform">
<input type="text" id="kategori" placeholder="Sila masukkan maklumat carian."/>
<button>Carian</button>
</form>
<hr/>
<h3>Maklumat</h3>
<ol>
{{#each profil}}
<li>{{jenama}}</li>
{{/each}}
</ol>
</template>
JS:
Template.search.events({
"submit #searchform": function (e) {
e.preventDefault();
Session.set("kategori", e.target.text.value);
}
});
Template.search.helpers({
profil: function() {
return Profil.find({
kategori: Session.get('kategori'),
});
}
});
お返事ありがとうございます。 Iron routerはどうですか?私はいくつかのデータ関数を入れておく必要があります。 – nurul
必ずしも、パラメータを使用して経路を検索しない限り、必ずしもそうではありません。 –