Newer Version Available
aura:locationChange
Indicates that the hash part of the URL has
changed.
This event is automatically fired when the hash part of the URL has changed, such
as when a new location token is appended to the hash. The aura:locationChange event is handled by a client-side controller. A
component can have only one <aura:handler
event="aura:locationChange"> tag to handle this event.
The aura:locationChange event contains
these attributes.
1<aura:handler event="aura:locationChange" action="{!c.update}"/>This
client-side controller handles the aura:locationChange
event.
The
aura:locationChange handler contains these
required attributes.
1({
2 update : function (component, event, helper) {
3 // Get the new location token from the event
4 var loc = event.getParam("token");
5 // Do something else
6 }
7})| Attribute Name | Type | Description |
|---|---|---|
| event | String | The name of the event, which must be set to aura:locationChange. |
| action | Object | The client-side controller action that handles the event. |
| Attribute Name | Type | Description |
|---|---|---|
| token | String | The hash part of the URL. |
| querystring | Object | The query string portion of the hash. |