Tuesday, July 11, 2017
Monday, July 10, 2017
Friday, July 7, 2017
lightning:spinner component
<aura:application controller="echoController" extends="force:slds">
<lightning:button label="Toggle" variant="brand" onclick="{!c.showSpinner}"/>
<div class="exampleHolder">
<lightning:spinner aura:id="mySpinner" class="slds-hide"/>
</div>
</aura:application>
({
showSpinner: function (component, event, helper) {
helper.showSpinner(component);
var action = component.get('c.echo');
action.setCallback(this,function(response){
var state = response.getState();
if (state === "SUCCESS") {
helper.hideSpinner(component);
}
});
$A.enqueueAction(action);
}
})
({
showSpinner: function (component, event, helper) {
var spinner = component.find("mySpinner");
$A.util.removeClass(spinner, "slds-hide");
},
hideSpinner: function (component, event, helper) {
var spinner = component.find("mySpinner");
$A.util.addClass(spinner, "slds-hide");
}
})
public class echoController {
@AuraEnabled
public static String echo(String message) {
return message;
}
}
Wednesday, June 28, 2017
Lightning: Advanced Events Example
This example is built on the simpler component and application event examples. It uses one notifier component and one handler component that work with both component and application events.
Reference: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_demo.htm
Subscribe to:
Posts (Atom)