function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Caleb KuesterCaleb Kuester 

Arrays of Defined Objects (Lightning)

Greetings! I need some assistance. 

I am a beginner to both Salesforce standard and Salesforce Lightning. 

I understand that traditional Salesforce is broken-up into a markup language and an OO language, specifically, Visualforce and Apex. When we come to Lightning, of course, everything had to be completely different syntax while retaining nearly the same fundamental main idea. There is a markup language and an OO component.

What are these two called? I can't Google my issues efficiently because I lack even the understanding of the terminology. As far as I'm aware, they have no names. I have been Googling a problem for several hours, to no avail. 

I am moving through one of the tutorials in trailhead. As I am directly copy/pasting the examples and following instructions, I am receiving an error. Instead of ignoring that error and moving to the next lesson, I'm hoping to find a way to resolve the problem.

I'm trying to figure out how to add items to an array in markup. 

I have an object: 
<aura:attribute name="firstSubject" type="Subject__c"
default="{ 'sobjectType': 'Subject__c',
                    'Name': 'qwerty',
                    'Number__c': 3,
                    'Name2__c': 'company',
                    'Yesterday__c': 'Aug 30, 2016',
                    'Hilarious__c': true}"/>
Afterward, I have an array declaration: 
<aura:attribute name="subjects" type="Subject__c[]" default ="{[v.firstSubject, v.firstSubject, v.firstSubject]}"/>
or is it: 
<aura:attribute name="subjects" type="Subject__c[]" default ="{[firstSubject, firstSubject, firstSubject]}"/>
or is it something else? I even tried with single quotes over them, as if they were strings. 

In any event, my loop: 
<aura:iteration items="{!v.subjects}" var="det">
    <p> Name: {!det.Name}</p>
</aura:iteration>
--prints nothing, no matter what I try to input as references to the declared object. 

Every example that I see on the internets uses strings as an example. How do I use something else?