while I'm going through the tutorial on Lightning Data Service, I can see that they use force:record data to perform all the CRUD operation and eliminate the need to write apex controller. but I did not understand the following syntax they use for it.
code:
<aura:attribute name="newContact" type="Object"/>
<aura:attribute name="simpleNewContact" type="Object"/>
<aura:attribute name="newContactError" type="String"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<force:recordData aura:id="contactRecordCreator"
layoutType="FULL"
targetRecord="{!v.newContact}"
targetFields="{!v.simpleNewContact}"
targetError="{!v.newContactError}" />
My question is: why are we defining two attributes namely newContact and simpleNewContact of type "Object" and assigning newContact in targetRecord and and simpleNewContact in targetField and why not use a single attribute named simpleNewContact alone.what is the purpose of newContact. also I'm searching for the definition targetRecord,targetFields,targetError please provide any link that explains in detail.