Lightning Batch 39
Lightning Batch 39
1st class--------------------
tejuworld component=======
<aura:component >
<h1 style="color:blue;fontsize:30px"><center>Welcome to Salesforce
Start</center></h1>
<h1
style="color:orange"><center>------------------------------------------------------
-------------------</center></h1>
<p>
<h1 style="color:green;fontsize:40px"> <p> <center>*****HERE WE CAN GIVE
ONLINE TRAINING AND PLACEMENTS***</center> </p><br/></h1>
<h1 style="color:Brown;fontsize:100px">
<center>
<p> 1.Salesforce Admin </p><br/>
<p> 2.Salesforce CPQ </p><br/>
<p> 3.salesforce Developer </p><br/>
<p> 4.salesforce Lightning </p><br/>
<p> 5.salesforce Aura </p><br/>
<p> 6.LigtninG Web Component </p><br/>
<p>><h1
style="color:red"><center>---------------------------------------------------------
----------------</center></h1></p>
</p>
</aura:component>
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
tejuworld test=======
<aura:application extends="force:slds">
<c:TejuWorld></c:TejuWorld>
</aura:application>
===================================================================================
========
parent component and child component:
<aura:component>
<aura:attribute name="pname" type="string" default="Chiru"></aura:attribute>
<div class="slds-box">
From parent component Message:{!v.pname}
</div>
<div class="slds-box">
<c:LTGchildcharan cname="RamCharan"></c:LTGchildcharan>
</div>
</aura:component>
===================================================
<aura:component>
<aura:attribute name="cname" type="string" default="Charan"></aura:attribute>
<div class="slds-box">
message from childcomponent charan : {!v.cname}
</div>
</aura:component>
====================================================================
dispaly contact:::::::::::::::::::::::::::apex class
public class CntcController {
@AuraEnabled
public static List<Contact> getContacts(string accId){
List<Contact> lstCons = new List<Contact>();
try{
lstCons = [select id, lastname, phone, email from contact WHERE
AccountId=:accId];
}catch(Exception e){
throw new AuraHandledException(e.getMessage());
}
return lstCons;
}
}
============================component________________________
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId"
controller="CntcController">
<aura:attribute name="lstCons" type="List" />
<aura:attribute name="recordId" type="String"></aura:attribute>
</lightning:card>
</div>
</aura:iteration>
</div>
</aura:component>
======================================js
controller_____________________________________
({
Contactdisplay : function(component, event, helper) {
var action = component.get("c.getContacts");
//action set params
action.setParams({
accId: component.get('v.recordId')
});
action.setCallback(this, function (responce){
var status= response.getState();
alert('Status :::'+status);
if(status ==="SUCCESS"){
var responseMsg = response.getReturnValue();
console.log(JSON.stringify(responseMsg));
component.set('v.lstCons', responseMsg);
} else if(state === "INCOMPLETE"){
}else if(state ==="ERROR"){
var errors = response.getError();
if(errors){
if(errors[0] && errors[0].message){
console.log('Error message:'+errors[0].message);
}
}
}else{
console.log("Unknownerror");
});
$A.enqueueAction(action);
}
})
=========================++++++++++++++++++++++++application of cntcdisplay
<aura:application >
<c:Cntctcontrollercmp></c:Cntctcontrollercmp>
</aura:application>