Last active
January 15, 2018 21:13
-
-
Save msrivastav13/feef2eee65728d74660ebe49f017302d to your computer and use it in GitHub Desktop.
Code to Show LockerService In 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
<aura:application extends="force:slds"> | |
<c:searchCmp /> | |
</aura:application> |
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="force:appHostable,flexipage:availableForAllPageTypes" access="global" > | |
<aura:attribute name="searchTerm" type="String" /> | |
<lightning:layout multipleRows="true" horizontalAlign="center" verticalAlign="center"> | |
<lightning:layoutItem flexibility="auto" size="6"> | |
<lightning:input type="search" aura:id="searchBox" label="Search" name="search" placeholder="Enter Search Term"/> | |
</lightning:layoutItem> | |
<lightning:layoutItem flexibility="auto" size="4" padding="horizontal-small"> | |
<lightning:button variant="brand" label="Search" title="" onclick="{! c.handleClick }" /> | |
</lightning:layoutItem> | |
<lightning:layoutItem flexibility="auto" padding="around-large" size="6"> | |
<p> You searched for {!v.searchTerm}</p> | |
</lightning:layoutItem> | |
</lightning:layout> | |
</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
({ | |
handleClick : function(component, event, helper) { | |
helper.setSearchTerm(component, event); | |
} | |
}) |
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
({ | |
setSearchTerm : function(component, event) { | |
var searchTerm = component.find('searchBox').getElement().value; | |
console.log(searchTerm); | |
component.set("v.searchTerm",searchTerm); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment