I cannot seem to get the fields from force:recordData available to my component. I'm fairly confident I have the syntax wrong, but I can't find the proper way to reference the data.
This code in the component works perfectly:
<force:recordData aura:id="record"
layoutType="FULL"
recordId="{!v.recordId}"
targetError="{!v.recordError}"
targetRecord="{!v.record}"
targetFields="{!v.simpleRecord}" />
<!--init is triggered on render and sets up columns and gets record data-->
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<!-- Display a lightning card with details about the record -->
<div class="Record Details">
<lightning:card iconName="standard:account" title="{!v.simpleRecord.Name}" >
<div class="slds-p-horizontal--small">
<p class="slds-text-heading--small">
<lightning:formattedText title="Invention" value="{!v.simpleRecord.Invention__c}" /></p>
<p class="slds-text-heading--small">
<lightning:formattedText title="Record Type" value="{!v.simpleRecord.RecordTypeId}" /></p>
</div>
</lightning:card>
</div>
I can get it to display the values that are obviously in the fields. However, I cannot get access to that same field in the js controller.
doInit : function(component, event, helper) {
//get record type of initial record
var passRecID = component.get("{!v.simpleRecord.RecordTypeId}");
console.log('The recordID pulled is ' + passRecID);
When I do that code, I get this error:
The recordID pulled is null