-
-
Save tyoshikawa1106/7167afd1a5e638ce10b0 to your computer and use it in GitHub Desktop.
How to Lightning Components - Part 2: Input & Output
This file contains 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:application> | |
<link rel="stylesheet" href="/resource/BootstrapSF1/dist/css/bootstrap.css" /> | |
<link rel="stylesheet" href="/resource/BootstrapSF1/dist/css/docs.min.css" /> | |
<script type="text/javascript" src="/resource/jQuery" /> | |
<script type="text/javascript" src="/resource/BootstrapSF1/dist/js/bootstrap.min.js" /> | |
<script type="text/javascript" src="/resource/BootstrapSF1/js/docs.js" /> | |
<!-- Header Component --> | |
<devjp:LightningBootstrapSF1Header header="How to Lightning Component" detail="- Sample Application -" /> | |
<!-- Input Component --> | |
<devjp:LightningInputComponent /> | |
</aura:application> |
This file contains 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> | |
<div class="padding"> | |
<form> | |
<fieldset> | |
<ui:InputText aura:Id="ui-inputText" label="Input Text" value="" | |
placeholder="Input Text" class="form-control" /> | |
</fieldset> | |
<fieldset> | |
<label for="ui-outputText">Output Text</label> | |
<ui:outputText aura:Id="ui-outputText" value="" class="form-control" /> | |
</fieldset> | |
<div class="btnMargin"> | |
<ui:button label="Submit" press="{!c.myAction}" /> | |
</div> | |
</form> | |
</div> | |
</aura:component> |
This file contains 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
({ | |
myAction : function(component, event, helper) { | |
helper.helperMethod(component); | |
} | |
}) |
This file contains 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
({ | |
helperMethod : function(component) { | |
var inputTextField = component.find("ui-inputText"); | |
var inputText = inputTextField.get("v.value"); | |
var outputTextField = component.find("ui-outputText"); | |
var outputText = outputTextField.set("v.value", inputText); | |
} | |
}) |
This file contains 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
.THIS { | |
} | |
.THIS.padding { | |
padding: 10px; | |
} | |
.THIS .btnMargin { | |
margin-top: 20px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment