私はMeteorの初心者です。次のようにルータ:私は鉄でデータコンテキストを設定テンプレートヘルパーのIron routerデータコンテキストを取得するには
Router.route('/:index', {
name:'randomText',
template: 'textsRandom',
data: function(){
textcol: Text.findOne({index: this.params.index})
}
}
とテンプレートtextsRandomで、私は私が後でテキスト内の特定の単語の色を変更したいので、ヘルパーにtextcol
にアクセスしたいです。
Template.textRandom.helpers({
mytexts: function(){
var texts = //code here to get textcol in router.js
//get some words from texts and change their colors
return texts;
}
})
これはどのように行うべきですか?おかげでたくさんの