私は流星を試しています。私はちょうど1つの関数から別の関数を呼び出すと、それは私にxxxが定義されていないと言って参照エラーを与えます。 JSファイルでMeteor - 同じテンプレートヘルパーで別の関数を呼び出す方法
<template name="hello">
{{getDaysInMonth}}
</template>
:
Template.hello.helpers({
getDaysInMonth: function(){
var now = new Date();
return getDaysInParticularMonth(now.getMonth(), now.getFullYear()); // Meteor does not find this function
},
getDaysInParticularMonth: function(month, year) {
console.log("hey");
return 0; //just for test
},
});
出力
ReferenceError: getDaysInParticularMonth is not defined
Plzを助け、私のHTMLファイルに
。おかげで、
元のコードが失敗した理由何らかの理由で、私のHTMLファイルに
? Template.instance()。methodname()がうまくいかない理由 – droidbee