---
schema_version: "1"
id: 7bba43cce5f17699650e96f96c4d59fa2a1bc96524528f0fa05ee14104ea83a2
title: Fire Application Events
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/events/events-application-fire.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/events-application-fire.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d68eabc63dd82e7e20a1ff4926fd2e7a1ee58ffc510a7959fc46aa69c5516003
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# Fire Application Events

Application events follow a traditional publish-subscribe model. An application event is fired from an instance of a component. All components that provide a handler for the event are notified.

## Register an Event

A component registers that it may fire an application event by using `<aura:registerEvent>` in its markup. The `name` attribute is required but not used for application events. The `name` attribute is only relevant for component events. This example uses `name="appEvent"` but the value isn’t used anywhere.

```nolang
<aura:registerEvent name="appEvent" type="c:appEvent"/>
```

## Fire an Event

Use `$A.get("e.myNamespace:myAppEvent")` in JavaScript to get an instance of the `myAppEvent` event in the `myNamespace` namespace.

**note:** The syntax to get an instance of an application event is different than the syntax to get a component event, which is `cmp.getEvent("evtName")`.

Use `fire()` to fire the event.

```javascript
var appEvent = $A.get("e.c:appEvent");
// Optional: set some data for the event (also known as event shape)
// A parameter’s name must match the name attribute
// of one of the event’s <aura:attribute> tags
//appEvent.setParams({ "myParam" : myValue });
appEvent.fire();
```

## Events Fired on App Rendering

Some events are automatically fired when an app is rendering. For more information, see [Events Fired During the Rendering Lifecycle](https://developer.salesforce.com/docs/platform/aura-platform/components/components-lifecycle.md).

**See Also**  


-   [Fire Component Events](https://developer.salesforce.com/docs/platform/aura-platform/guide/events-component-fire.md)

