Constructor
new NavigationDelegate()
Methods
back()
Navigates backward in history.
destroy()
Destroys the delegate and cleans up event listeners.
forward()
Navigates forward in history.
getActiveRouters() → {Set:.<object:>}
Returns all active router instances.
Returns:
getHash() → {string}
Gets the current location hash string (e.g. '#/home').
Returns:
- Type
- string
go(delta)
Navigates to a specific history position relative to current position.
Parameters:
| Name | Type | Description |
|---|---|---|
delta |
number | Relative step count in history (e.g. -1 for back, 1 for forward). |
onHashChange() → {function}
Subscribes to location/hash change events.
Returns:
Unsubscribe function.
- Type
- function
onLinkClick() → {function}
Subscribes to click events on links (e.g. [data-ax-link]).
Returns:
Unsubscribe function.
- Type
- function
registerRouter()
Registers a router instance for active router tracking.
setHash(hash, optionsopt)
Navigates/sets the current location hash string.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
hash |
string | The target hash. |
|
options |
object |
<optional> |
Navigation options such as replace. |
setTitle()
Sets the document or in-memory title.
unregisterRouter()
Unregisters a router instance.