this.$.testComp.a
evaluates to undefined
while this.$.testComp.published.a
evaluates to "A"
as expected. This fiddle demonstrates the issue: http://jsfiddle.net/pwnosaurus/yNyn4/ What am I doing wrong here?
enyo.kind({ name: "test", components:[ {kind: enyo.Button, content:"foo", ontap: "doIt"}, ], doIt: function(){ //instantiate a new component this.createComponent({ name: "testComp", content: "bar", published: { a: "A", } }); this.render(); this.log(this.$.testComp.a); //logs undefined this.log(this.$.testComp.published.a); //logs A }, }); foo = new test(); foo.renderInto(document.body);
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
this.$.testComp.getA();
Here's an expanded example based on your fiddle
http://jsfiddle.net/yNyn4/1/