如何向控制台打印我已导入到自定义元素中的元素的所有属性。聚合物1.x:如何打印聚合物元素的所有属性?
例如,我有一个自定义元素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);
}
通过作品,我的意思是它不会产生打印对象到控制台的期望的行为。该对象是doc
对象的all the properties对象。从评论
你试过'console.dir(doc)'吗? – Supersharp
@Supersharp:有效。谢谢。 – Mowzer