【发布时间】:2013-08-09 08:28:32
【问题描述】:
我创建了测试 Meteor 应用程序,我发现可以使用客户端上的开发工具查看整体代码(服务器端也是如此)。 测试应用(在浏览器中):
(function(){ if (Meteor.isClient) {
Template.hello.greeting = function () {
return "Welcome to test_app.";
};
Template.helo.events({
'click input' : function () {
// template data, if any, is available in 'this'
if (typeof console !== 'undefined')
console.log("You pressed the button");
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}
}).call(this);
这是设计使然吗?服务端代码可以留在服务端吗?
【问题讨论】:
标签: javascript node.js meteor