Registering application events

To register an application event, the notifier (or the publisher component) should have the following snippet in the markup:

<aura:registerEvent name="appEvent" type="c:appEvent"/>

Notice that we need the name attribute here, but it is not used anywhere else. Also, notice that for the type of the event, we specify the event filename, prefixed with a colon :, and the namespace (for an application with no namespace, we always use c:).

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.