如何查看手柄模板中的所有可用变量 [英] How to see all available variables in handlebars template
问题描述
有一个相关的问题,但是你必须知道在使用范围内:
如何在Handlebars模板中添加console.log()JavaScript逻辑?
如何输出 所有 变量?
确保你尝试Firebug - 你会得到一个不同的对事物的看法,我觉得有帮助。但不要完全放弃铬;某些时候您将需要 Ember Inspector 。
我正在使用同样的调试帮助器大家推荐,这是Chrome显示的方式:
当我在firebug中展开相同的对象时,我得到以下信息,包括我正在寻找的变量(sources [])以及我在Chrome中没有看到的其他一些有用的属性。
I'm working on my first Ember.js app and am having some trouble connecting all the dots. It would be really helpful if I could just see all the variables available within a given handlebars template.
There is a related question, but you have to know the variable that is in scope to use it: How do I add console.log() JavaScript logic inside of a Handlebars template?
How can I output all the variables?
Make sure you try out Firebug - you'll get a different perspective on things, which I found helpful. But don't abandon chrome completely; you will need the Ember Inspector at some point.
I'm using the same debugging helper everyone recommends, and this is how Chrome displays it:
When I expand the same object in firebug, I get the following info, including the variables I was looking for (sources[]) and some other useful properties I hadn't seen in Chrome.
这篇关于如何查看手柄模板中的所有可用变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!