javascript - Pass object properties by reference with Polymer -
i have polymer <parent-element>
contains large js object.
within <parent-element>
, have n <child-element>
both consume large js object.
if pass large js object <child-element>
property create "deep" copy.
// in <parent-element> <div> <child-element id="child1" largeobject="{{largeobject}}"></child-element> <child-element id="child2" largeobject="{{largeobject}}"></child-element> //... </div>
which best practice pass element reference?
just attach <child-element>
programmatically?
// in <parent-element> ready: function(){ this.$.child1.largeobject = this.largeobject; }
thanks!
all happening reference syntax:
// in <parent-element> <div> <child-element id="child1" largeobject="{{largeobject}}"></child-element> <child-element id="child2" largeobject="{{largeobject}}"></child-element> //... </div>
Comments
Post a Comment