template模板中插入自定义参数
辅助方法(解决模板不能访问全局对象的问题)
使用 template.helper(name, callback) 注册公用辅助方法,例如一个访问全局变量jQuery的方法:
template.helper('getJquery', function () {
return $;
});
模板中使用的方式:
{{getIquery()}}
template.helper('getJquery', function () {
return $;
});