Created
August 6, 2016 22:03
-
-
Save mtetlow/876171bec75c93c91d0396b4ebdc66a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="forceCommunity:availableForAllPageTypes,flexipage:availableForAllPageTypes,force:hasRecordId" controller="trTestCtrl" access="global"> | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> | |
<aura:attribute name="testStr" type="String" default="default value" /> | |
<div>{!v.testStr}</div> | |
</aura:component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
doInit : function(component, event, helper) { | |
var action = component.get("c.getTest"); | |
action.setCallback(this, function(response){ | |
var state = response.getState(); | |
if(state === "SUCCESS"){ | |
var str = response.getReturnValue(); | |
component.set('v.testStr', str); | |
} | |
}); | |
$A.enqueueAction(action); | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class trTestCtrl { | |
public trTestCtrl() { | |
} | |
@AuraEnabled | |
public static String getTest(){ | |
return 'yay from server'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment