Emberjs - 当{{#each}}不加载模型时,调试器不显示错误

时间:2014-03-18 20:56:56

标签: javascript debugging ember.js google-chrome-devtools

我正在使用{{#each}}把手来显示记录名称列表。记录名称未显示。我没有收到任何错误,Chrome扩展程序Ember调试程序仅显示

"RecordCategories
recordCategories
<DS.RecordArray:ember923> Send to console
VpcYeoman.RecordCategoriesController Send to console
VpcYeoman.RecordCategoriesView Send to console"

在调试器的/ #Routes部分中。 “记录类别”下的余烬调试器的“数据”部分中没有任何内容。

如果Ember Debugger和控制台都没有确认存在错误,我想如何找出此错误的来源?当我进入Ember调试器时,我错过了什么?到目前为止,它完全没用,告诉我我可以在普通的Chrome开发工具中找到的信息

Chrome Version  = 33.0.1750.152,
Ember --version = 0.2.8, (I'm not sure why it is displaying the ember tools version instead of the ember version)
Ember Data Version = ? ( i could not find where to check the version of this)

我还应该提一下,我几天前就开始工作了。我与另一个团队的代码合并,发生了这个问题。

1 个答案:

答案 0 :(得分:1)

在回答您的问题时,我想如何找出此错误的来源:

  1. 使用模板{{log model}},{{log model.length}}
  2. 中的日志记录
  3. 将模型注入页面{{model}},{{model.length}}
  4. 将模型设为全局变量,并在控制台globalVar.get中使用它(&#39; length&#39;)
  5. Ember没有报告非错误,也就是说,如果您没有数据,如果收集为空,则不会出错。如果您尝试迭代非集合,那将是一个错误。