Mastering Lightning Framework Part 1
Why Salesforce Stack Exchange recommends it
Salesforce Stack Exchange answerers link it as background on how Aura/Lightning components work under the hood when explaining binding, rendering and component attributes.
Recommended by 1 people across 1 different months, 2016 to 2016.
What it is
A 2016 Salesforce Developers session, the first of two parts, covering the same Lightning Framework training that Salesforce engineers get during onboarding. Part 1 explains component definition: component-based architecture, structure, implementation and key components.
What people said
Recommends Mohith Shrivastava · 2016-10 · Salesforce Stack Exchange · on “How does component.set works underneath the hood”
The answer to this lies in the rendering lifecycle explanation [LINK] of the lightning components Under the hood lightning components are formed from the XML from the server Lighnting isn't a JS template engine which parses the template file to replace variables (Templates ---> HTML---> DOM) 1.The Server creates Java objects from component XML 2.Components are Serialized to JSON 3.The client creates JS component instances 4.The JS components create DOM elements XML---> JAVA--> JSON--->JS--->DOM When your component is finished rendering ,for all the values that has changed you will see a value change event thats fired and all the changed values stored in a list on the rendering service,result
Cites JF Paradis · 2016-07 · Salesforce Stack Exchange · on “component.get(v.body) not working as expected”
@Praveen, yes, this is totally normal. Here is what is happening: When we say that the body attribute is defined on all components we mean that it's defined on the base <aura:component/> from which all components inherit. Here is a simplified version. <aura:component/> <aura:attribute name="body" type="Aura.Component[]"/> {!v.body} </aura:component> As you can see, the base component outputs the body tag that it receives in its own body, otherwise, nothing would be rendered. Angular calls that process "transclusion", the inclusion of content from another context. When you write this: <aura:component> <div>Body part</div> <ui:button label="Push Me" press="{!c.printCmpBody}"/> </aura:component
Cites Praveen · 2016-08 · Salesforce Stack Exchange · on “When to use {#v.attrib} vs {!v.attrib}?”
If you want to show a value dynamically based on a aura:attribute, generally we tend to use: {!v.attrib} Eg: <ui:button label="{!v.attrib}" /> So if you do cmp.set('v.attrib','test') , then aura:framework automagically does an dirty checking and changes the value accordingly.( Two-way binding ) So the label of the <ui:button> is set to test , just think of this as special expression that directly point to the live reference of the attribute in the component(JS perspective), which is quiet similar to {{v.attrib}} expression in Angularjs which eventually does the same thing. What if you want to show a value dynamically based on a aura:attribute but it needs to work only once,when it is rendere