You need to sign in to do that
Don't have an account?
Dan Lord
set attributes on sub-component (aura)
I have this aura code:
How can I maintain the original values in the copy?
<aura:iteration items="{!v.giaList}" var="giaRecord" indexVar="number"> <c:GIO_GauListItem origGiaRecord="{!giaRecord}" giaRecord="{!giaRecord}" /> </aura:iteration>In GIO_GauListItem.cmp, I have:
<aura:attribute name="giaRecord" type="Object" /> <aura:attribute name="origGiaRecord" type="Object" />But, in the sub-component, when giaRecord changes, so does origGiaRecord. Are these values being passed by reference from the parent component? that is, not actually two instances of the object?
How can I maintain the original values in the copy?
For this question, the answer can be found here:
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.migrate_data_binding
All Answers
What I would really like to do is this:
along with but, that has the same effect; when the giaRecord changes, so do those values.
For this question, the answer can be found here:
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.migrate_data_binding