【发布时间】:2016-04-29 16:29:50
【问题描述】:
我正在尝试 Meteor。我只想从一个函数调用另一个函数,它给了我参考错误说 xxx 未定义。
在我的 html 文件中:
<template name="hello">
{{getDaysInMonth}}
</template>
在js文件中:
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
请帮忙。谢谢,
【问题讨论】:
标签: javascript meteor