Skip to content

Instantly share code, notes, and snippets.

@msrivastav13
Created February 29, 2016 02:37
Show Gist options
  • Save msrivastav13/2b214b9cc709d7aba3c2 to your computer and use it in GitHub Desktop.
Save msrivastav13/2b214b9cc709d7aba3c2 to your computer and use it in GitHub Desktop.
<aura:component>
<div> Hello World !!!! </div>
<aura:registerEvent name="myevent" type="c:myEvent" />
<ui:button label="fireEvent" press="{!c.fireevent}" />
</aura:component>
({
fireevent: function(component, event, helper) {
var myEvent = $A.get("e.c:myEvent");
myEvent.setParams({"data":"Test"});
myEvent.fire();
}
})
<aura:event type="APPLICATION">
<aura:attribute type="string" name="data" />
</aura:event>
<aura:application access="GLOBAL" extends="ltng:outApp">
<aura:dependency resource="c:myComponent" />
</aura:application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment