Skip to content

Instantly share code, notes, and snippets.

@rsussland
Last active February 24, 2016 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsussland/135bc5bde14674b34029 to your computer and use it in GitHub Desktop.
Save rsussland/135bc5bde14674b34029 to your computer and use it in GitHub Desktop.
contract violation example
App:
<aura:application >
<aura:attribute name="display" type="Boolean" default="true"/>
<ui:button aura:id="button" label="Click to toggle" press="{!c.toggle}"/>
<aura:renderif isTrue="{!v.display}">
Here's some text!
<aura:set attribute="else">
Here's a react component:
<c:ReactSearch />
</aura:set>
</aura:renderif>
</aura:application>
Controller:
({
toggle : function(component, event, helper) {
component.get('v.display') ? component.set('v.display', false): component.set('v.display', true);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment