Created
May 1, 2018 21:31
-
-
Save brianmfear/de57ea8aad4643df2738e444afadf426 to your computer and use it in GitHub Desktop.
Demonstration of one-way binding vs two-way binding
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 > | |
<aura:attribute name="demo" type="Boolean" default="{!true}" /> | |
<aura:if isTrue="{#v.demo}"> | |
Unbound Set | |
<aura:set attribute="else"> | |
Unbound Unset | |
</aura:set> | |
</aura:if> | |
<hr /> | |
<aura:if isTrue="{!v.demo}"> | |
Bound Set | |
<aura:set attribute="else"> | |
Bound Unset | |
</aura:set> | |
</aura:if> | |
<hr /> | |
<ui:button label="Toggle" press="{!c.toggle}" /> | |
</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
({ | |
toggle: function(component, event, helper) { | |
component.set("v.demo", !component.get("v.demo")); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment