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> 

https://jsbin.com/fozotu/edit?html,console,output


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -