【发布时间】:2014-04-18 22:31:12
【问题描述】:
这可能是 2 个问题...
1) 是否有使用模板和会话更改页面的最佳方法?或者逻辑应该在 html
中2) 我在模板 b 和 c 中有多个带有捕获按钮的表单。更新meteor.user .....我收到这个错误...
未捕获的 RangeError: 超出最大调用堆栈大小 ejson.js:351 EJSON.cloneejson.js:351(匿名函数)ejson.js:386 .each..forEachunderscore.js:113 EJSON.cloneejson.js:385(匿名函数)ejson.js:386 .each..forEach
在客户端.... HTML
template name="a" xxxxxx {{{page}}} /template
template name="b" xxxxxx {{var1}} /template
template name="c" xxxxxx Form.... {{var2}} /template
在客户端.... JS
如果 session_page = "a"
template.a.page = template.b({var1: test})
其他.....
template.a.page = template.c({var2: test}) ....
非常感谢。我一直在努力解决这个问题,并怀疑它是如何布置模板的,这会导致绑定反应性子模板时出现循环……而这次红牛没有帮助。
抱歉,我无法发布所有代码.. 目前它有点像面条。
【问题讨论】:
-
对于第一个问题,您应该使用iron-router 等路由器来处理更改页面。
-
嗨,cuberto。谢谢。我正在尝试使整个页面具有反应性,因为我需要路由以供其他用途。他们这样做有什么副作用吗?
标签: javascript templates meteor