Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
60 Salesforce Lightning Developer Interview Questions & Answers
60 Salesforce Lightning Developer Interview Questions & Answers
<aura:attribute name="firstName" type="String”/>
<aura:attribute name="firstName" type="String”/>
In the component markup: &amp;lt;lightning:button label="SUBMIT" onclick="{!c.doSubmit}"/&amp;gt;
In the controller:
({
doSubmit:function(component, event, helper) {
// Some operations.
}
)}
<aura:handler name="change"value="{!v.&lt;strong&gt;attributeNameWhereValueChangeOccured&lt;/strong&gt;}"action="{!c.doinit}"/&amp;>
<aura:handler name="init" value="{!this}" action="{!c.doInitialization}"/
<aura:component>
<c:ChildComp aura:id="ChildCompId"/>
</aura:component>
var childCompId=component.find("ChildCompId");
var res=childComponent.chilCompMethod("From parent");
<aura:component>
<aura:method name="chilCompMethod" action="{!c.doAction}">
<aura:attribute name="receiveValueFromParent" type="String"/>
</aura:method>
</aura:component>
({
doAction:function(component, event, helper){
var params=event.getParam('arguments');
if(params)
{
var param1=params.receiveValueFromParent;}
return param1+"Appended child value";}
)}
<aura:component>
<c:ChildComp childAttributeName="{!v.parentAttributeName}">
</aura:component>
<aura:component&gt>
<c:ChildComp childAttributeName="{#v.parentAttributeName}">;
</aura:component>
{
"type": "standard__component",
"attributes": {
"componentName": "c__MyLightningComponent
},
"state": {
"myAttr": "attrValue"
}
}
<aura:attribute name="firstName" type="String"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment