[英]Meteor Error: No such function: only in production mode
My App is running perfectly in debug mode but when I run it in production mode I get: 我的应用程序在调试模式下运行完美,但是在生产模式下运行时,我得到:
Error: No such function: canAddMore
错误:无此类功能:canAddMore
Here is the JS code I have: 这是我拥有的JS代码:
Template.fbRegister.helpers({
jobCount: function() {
return Session.get("jobCount");
},
eduCount: function() {
return Session.get("eduCount");
},
moreThanOneJob: function() {
return Session.get('jobCount').length > 1
},
moreThanOneEdu: function() {
return Session.get('eduCount').length > 1
},
canAddMore: function(count) {
console.log(count)
return count.length <= 2
},
});
And here is the HTML code: 这是HTML代码:
{{#if canAddMore jobCount}}<a class="normal-link add-job">+ Add another Job</a>{{/if}}
What am I doing wrong here? 我在这里做错了什么?
Your code probably breaks in production, due to several missing semicolons . 由于缺少几个分号 ,您的代码可能会中断生产。 When deploying your Meteor application, your code will be minified .
部署Meteor应用程序时,您的代码将被缩小 。 During this process, blank lines will be removed and therefore it would be no longer possible to distinguish when a statement ends.
在此过程中,空白行将被删除,因此不再可能区分语句何时结束。
Please try: 请试试:
Template.fbRegister.helpers({
jobCount: function () {
return Session.get("jobCount");
},
eduCount: function () {
return Session.get("eduCount");
},
moreThanOneJob: function () {
return Session.get('jobCount').length > 1;
},
moreThanOneEdu: function () {
return Session.get('eduCount').length > 1;
},
canAddMore: function (count) {
console.log(count);
return count.length <= 2;
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.