【发布时间】:2017-01-07 01:58:34
【问题描述】:
如何将我已导入自定义元素的元素的所有属性打印到控制台。
例如,我有一个自定义元素 my-el,在该元素中,我导入了一个 firebase-document 元素。我想通过在特定时间点观察firebase-document 的所有属性的值来了解firebase-document 元素的模型的当前状态。
<firebase-document id="document"
app-name="my-app"
data="{{data}}">
</firebase-document>
...
foo: function() {
...
var doc = this.$.document;
// Neither of the following "works" (see below for definition)
console.log('doc', doc);
console.log('doc.properties', doc.properties);
}
works,我的意思是它不会产生将对象打印到控制台的期望行为。对象是all the properties 的doc 对象。
【问题讨论】:
-
你试过
console.dir( doc )吗? -
@Supersharp:行得通。谢谢。
标签: polymer polymer-1.0 custom-element